Commit b34aaf6c5f6b33062b3ccff6b80744492bd2b8f2

Anders Borum 2021-06-14T14:39:20

test that specific lines can negate broader ignore lines

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
diff --git a/tests/ignore/path.c b/tests/ignore/path.c
index 5d53c9d..d55bdc5 100644
--- a/tests/ignore/path.c
+++ b/tests/ignore/path.c
@@ -575,3 +575,11 @@ void test_ignore_path__negative_prefix_rule(void)
 	assert_is_ignored(true, "ff");
 	assert_is_ignored(false, "f");
 }
+
+void test_ignore_path__negative_more_specific(void)
+{
+	cl_git_rewritefile("attr/.gitignore", "*.txt\n!/dir/test.txt\n");
+	assert_is_ignored(true, "test.txt");
+	assert_is_ignored(false, "dir/test.txt");
+	assert_is_ignored(true, "outer/dir/test.txt");
+}