Commit b7b77def by Russell Belfer

Match against file with leading ! was too broad

parent 4ba64794
...@@ -166,7 +166,8 @@ static int pathspec_match_one( ...@@ -166,7 +166,8 @@ static int pathspec_match_one(
if (result == FNM_NOMATCH && if (result == FNM_NOMATCH &&
(match->flags & GIT_ATTR_FNMATCH_NEGATIVE) != 0 && (match->flags & GIT_ATTR_FNMATCH_NEGATIVE) != 0 &&
*path == '!' && *path == '!' &&
ctxt->strncomp(path + 1, match->pattern, match->length) == 0) ctxt->strncomp(path + 1, match->pattern, match->length) == 0 &&
(!path[match->length + 1] || path[match->length + 1] == '/'))
return 1; return 1;
if (result == 0) if (result == 0)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment