]> git.proxmox.com Git - libgit2.git/commitdiff
Fix 'If we're dealing with a directory' check
authorVsevolod Parfenov <vsevolodp@gmail.com>
Mon, 24 Aug 2015 15:47:48 +0000 (18:47 +0300)
committerVsevolod Parfenov <vsevolodp@gmail.com>
Mon, 24 Aug 2015 15:47:48 +0000 (18:47 +0300)
src/ignore.c

index 0031e4696cee1cc55b1dbdf25878bde23fcaf887..1f33687bcbb5e01bf6d2905575e1be742fc1fc0a 100644 (file)
@@ -97,7 +97,7 @@ static int does_negate_rule(int *out, git_vector *rules, git_attr_fnmatch *match
                if (rule->containing_dir) {
                        git_buf_puts(&buf, rule->containing_dir);
                }
-               if (!strchr(rule->pattern, '*'))
+               if (rule->flags & GIT_ATTR_FNMATCH_LEADINGDIR && !(rule->flags & GIT_ATTR_FNMATCH_NEGATIVE))
                        error = git_buf_printf(&buf, "%s/*", rule->pattern);
                else
                        error = git_buf_puts(&buf, rule->pattern);