diff options
author | Elijah Newren <newren@gmail.com> | 2019-12-10 21:00:23 +0100 |
---|---|---|
committer | Junio C Hamano <gitster@pobox.com> | 2019-12-11 21:23:23 +0100 |
commit | 072a231016e5da347c3a8ff38afb72e7876dd1d7 (patch) | |
tree | f3c01dc53048c3c563acdc08b2b86ab76c3736ea /dir.c | |
parent | dir: remove stray quote character in comment (diff) | |
download | git-072a231016e5da347c3a8ff38afb72e7876dd1d7.tar.xz git-072a231016e5da347c3a8ff38afb72e7876dd1d7.zip |
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>
Diffstat (limited to 'dir.c')
-rw-r--r-- | dir.c | 7 |
1 files changed, 7 insertions, 0 deletions
@@ -380,6 +380,13 @@ static int match_pathspec_item(const struct index_state *istate, return 0; /* + * name has no wildcard, and it didn't match as a leading + * pathspec so return. + */ + if (item->nowildcard_len == item->len) + return 0; + + /* * Here is where we would perform a wildmatch to check if * "name" can be matched as a directory (or a prefix) against * the pathspec. Since wildmatch doesn't have this capability |