Commit 7d3305417bf01d0d8591c322e0b28423df01e4ce

Edward Thomson 2019-05-19T16:33:28

ignore: test that comments begin at position 0 Comments must have a '#' at the beginning of the line. For compatibility with git, '#' after a whitespace is a literal part of the filename.

diff --git a/tests/status/ignore.c b/tests/status/ignore.c
index 8bfaae3..c43f314 100644
--- a/tests/status/ignore.c
+++ b/tests/status/ignore.c
@@ -1251,14 +1251,18 @@ void test_status_ignore__leading_spaces_are_significant(void)
 	cl_git_mkfile(
 		"empty_standard_repo/.gitignore",
 		" a.test\n"
+		"# this is a comment\n"
 		"b.test\n"
 		"\tc.test\n"
+		" # not a comment\n"
 		"d.test\n");
 
 	refute_is_ignored("a.test");
 	assert_is_ignored(" a.test");
+	refute_is_ignored("# this is a comment");
 	assert_is_ignored("b.test");
 	refute_is_ignored("c.test");
 	assert_is_ignored("\tc.test");
+	assert_is_ignored(" # not a comment");
 	assert_is_ignored("d.test");
 }