dir: exit before wildcard fall-through if there is no wildcard

The DO_MATCH_LEADING_PATHSPEC had a fall-through case for if there was a
wildcard, noting that we don't yet have enough information to determine
if a further paths under the current directory might match due to the
presence of wildcards.  But if we have no wildcards in our pathspec,
then we shouldn't get to that fall-through case.

Signed-off-by: Elijah Newren <newren@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
This commit is contained in:
Elijah Newren
2019-12-10 20:00:23 +00:00
committed by Junio C Hamano
parent 2f5d3847d4
commit 072a231016
2 changed files with 9 additions and 2 deletions

View File

@ -92,7 +92,7 @@ test_expect_failure 'git ls-files -o untracked_repo/ does not recurse' '
test_cmp expect actual
'
test_expect_failure 'git ls-files -o untracked_dir untracked_repo recurses into untracked_dir only' '
test_expect_success 'git ls-files -o untracked_dir untracked_repo recurses into untracked_dir only' '
cat <<-EOF >expect &&
untracked_dir/empty
untracked_repo/
@ -110,7 +110,7 @@ test_expect_success 'git ls-files -o untracked_dir/ untracked_repo/ recurses int
test_cmp expect actual
'
test_expect_failure 'git ls-files -o --directory untracked_dir untracked_repo does not recurse' '
test_expect_success 'git ls-files -o --directory untracked_dir untracked_repo does not recurse' '
cat <<-EOF >expect &&
untracked_dir/
untracked_repo/