Commit 6d0defe31c67a61f2f38894a2e4db7818a952d60

Vsevolod Parfenov 2015-08-24T18:47:48

Fix 'If we're dealing with a directory' check

1
2
3
4
5
6
7
8
9
10
11
12
13
diff --git a/src/ignore.c b/src/ignore.c
index 0031e46..1f33687 100644
--- a/src/ignore.c
+++ b/src/ignore.c
@@ -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);