Unverified Commit 6d2a6f3e by Edward Thomson Committed by GitHub

Apply suggestions from code review

parent b34aaf6c
...@@ -141,14 +141,14 @@ static int does_negate_rule(int *out, git_vector *rules, git_attr_fnmatch *match ...@@ -141,14 +141,14 @@ static int does_negate_rule(int *out, git_vector *rules, git_attr_fnmatch *match
if (git_buf_oom(&buf)) if (git_buf_oom(&buf))
goto out; goto out;
/* if rule isn't for full path we match without PATHNAME flag /*
* if rule isn't for full path we match without PATHNAME flag
* as lines like *.txt should match something like dir/test.txt * as lines like *.txt should match something like dir/test.txt
* requiring * to also match / * requiring * to also match /
*/ */
effective_flags = wildmatch_flags; effective_flags = wildmatch_flags;
if (!(rule->flags & GIT_ATTR_FNMATCH_FULLPATH)) { if (!(rule->flags & GIT_ATTR_FNMATCH_FULLPATH))
effective_flags &= ~WM_PATHNAME; effective_flags &= ~WM_PATHNAME;
}
/* if we found a match, we want to keep this rule */ /* if we found a match, we want to keep this rule */
if ((wildmatch(git_buf_cstr(&buf), path, effective_flags)) == WM_MATCH) { if ((wildmatch(git_buf_cstr(&buf), path, effective_flags)) == WM_MATCH) {
......
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