summaryrefslogtreecommitdiff
path: root/src/ignore.c
diff options
context:
space:
mode:
authorCarlos Martín Nieto <cmn@dwim.me>2015-05-20 21:18:25 +0200
committerCarlos Martín Nieto <cmn@dwim.me>2015-05-20 21:49:02 +0200
commit2c57114f1117ea94e3023d989018748be76d52eb (patch)
treefcb846a88b016e193a9316af5d3988d4238920a6 /src/ignore.c
parentcd3f3c2844715b12583eb4d4a6129d3050f115a4 (diff)
downloadlibgit2-2c57114f1117ea94e3023d989018748be76d52eb.tar.gz
ignore: clear the error when matching a pattern negationcmn/ignored-ignore
When we discover that we want to keep a negative rule, make sure to clear the error variable, as it we otherwise return whatever was left by the previous loop iteration.
Diffstat (limited to 'src/ignore.c')
-rw-r--r--src/ignore.c1
1 files changed, 1 insertions, 0 deletions
diff --git a/src/ignore.c b/src/ignore.c
index 7ad8500e8..0031e4696 100644
--- a/src/ignore.c
+++ b/src/ignore.c
@@ -80,6 +80,7 @@ static int does_negate_rule(int *out, git_vector *rules, git_attr_fnmatch *match
git_vector_foreach(rules, i, rule) {
if (!(rule->flags & GIT_ATTR_FNMATCH_HASWILD)) {
if (does_negate_pattern(rule, match)) {
+ error = 0;
*out = 1;
goto out;
}