diff options
author | Edward Thomson <ethomson@edwardthomson.com> | 2019-07-20 11:26:00 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2019-07-20 11:26:00 +0100 |
commit | e07dbc92d113fbddd2a042b45ef1a01347492a4c (patch) | |
tree | 0729eacdcdc78f7a134ff4d4baa2667b911e15cc /src/ignore.c | |
parent | fd7a384b6849a407677c592f269603f4075d662a (diff) | |
parent | 6f6340afeca17bf0773e2450efc7c96f7ca8bd5d (diff) | |
download | libgit2-e07dbc92d113fbddd2a042b45ef1a01347492a4c.tar.gz |
Merge pull request #5173 from pks-t/pks/gitignore-wildmatch-error
ignore: fix determining whether a shorter pattern negates another
Diffstat (limited to 'src/ignore.c')
-rw-r--r-- | src/ignore.c | 7 |
1 files changed, 1 insertions, 6 deletions
diff --git a/src/ignore.c b/src/ignore.c index 825ab3cf9..c2d99444b 100644 --- a/src/ignore.c +++ b/src/ignore.c @@ -141,13 +141,8 @@ static int does_negate_rule(int *out, git_vector *rules, git_attr_fnmatch *match if (git_buf_oom(&buf)) goto out; - if ((error = wildmatch(git_buf_cstr(&buf), path, wildmatch_flags)) < 0) { - git_error_set(GIT_ERROR_INVALID, "error matching pattern"); - goto out; - } - /* if we found a match, we want to keep this rule */ - if (error != WM_NOMATCH) { + if ((wildmatch(git_buf_cstr(&buf), path, wildmatch_flags)) == WM_MATCH) { *out = 1; error = 0; goto out; |