Skip to content

Commit 7d33054

Browse files
committed
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.
1 parent 1916490 commit 7d33054

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

tests/status/ignore.c

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1251,14 +1251,18 @@ void test_status_ignore__leading_spaces_are_significant(void)
12511251
cl_git_mkfile(
12521252
"empty_standard_repo/.gitignore",
12531253
" a.test\n"
1254+
"# this is a comment\n"
12541255
"b.test\n"
12551256
"\tc.test\n"
1257+
" # not a comment\n"
12561258
"d.test\n");
12571259

12581260
refute_is_ignored("a.test");
12591261
assert_is_ignored(" a.test");
1262+
refute_is_ignored("# this is a comment");
12601263
assert_is_ignored("b.test");
12611264
refute_is_ignored("c.test");
12621265
assert_is_ignored("\tc.test");
1266+
assert_is_ignored(" # not a comment");
12631267
assert_is_ignored("d.test");
12641268
}

0 commit comments

Comments
 (0)