Skip to content

Commit 1c7c1d1

Browse files
Clemens Buchachergitster
authored andcommitted
clean up pathspec matching
If pathspec already matched exactly, it cannot match any more. Originally, we had to continue anyways, because we did not differentiate between exact, recursive and globbing matches. Signed-off-by: Clemens Buchacher <[email protected]> Signed-off-by: Junio C Hamano <[email protected]>
1 parent 8dca683 commit 1c7c1d1

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

dir.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -118,7 +118,7 @@ int match_pathspec(const char **pathspec, const char *name, int namelen, int pre
118118

119119
for (retval = 0; (match = *pathspec++) != NULL; seen++) {
120120
int how;
121-
if (retval && *seen == MATCHED_EXACTLY)
121+
if (*seen == MATCHED_EXACTLY)
122122
continue;
123123
match += prefix;
124124
how = match_one(match, name, namelen);

0 commit comments

Comments
 (0)