[PATCH 1/3] clean up pathspec matching
- From
Clemens Buchacher <drizzd@aon.at>
- Date
- Jan 14, 2009, 14:54 UTC
- Message-ID
- <1231944876-29930-2-git-send-email-drizzd@aon.at>
- In-Reply-To
- <1231944876-29930-1-git-send-email-drizzd@aon.at>
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 <drizzd@aon.at> --- dir.c | 2 +- 1 files changed, 1 insertions(+), 1 deletions(-)
diff --git a/dir.c b/dir.c index 7c59829..87a9758 100644 --- a/dir.c +++ b/dir.c @@ -118,7 +118,7 @@ int match_pathspec(const char **pathspec, const char *name, int namelen, int pre for (retval = 0; (match = *pathspec++) != NULL; seen++) { int how; - if (retval && *seen == MATCHED_EXACTLY) + if (*seen == MATCHED_EXACTLY) continue; match += prefix; how = match_one(match, name, namelen);
-- 1.6.1