pathspec: fix pathspecs with '/' at the end