summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorEdward Thomson <ethomson@edwardthomson.com>2019-05-19 16:33:28 +0200
committerEdward Thomson <ethomson@edwardthomson.com>2019-05-24 16:04:25 +0200
commit7d3305417bf01d0d8591c322e0b28423df01e4ce (patch)
tree72c159d8f05776717760c793f1cc149675b2f969
parent191649010595f533c5ba20ab05d5447d233cf86b (diff)
downloadlibgit2-7d3305417bf01d0d8591c322e0b28423df01e4ce.tar.gz
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.
-rw-r--r--tests/status/ignore.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/tests/status/ignore.c b/tests/status/ignore.c
index 8bfaae352..c43f31458 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");
}