Correctly return matched pathspec when passing "*" or "."