Skip to content

Commit 73a157e

Browse files
committed
ignore: test we can handle an ignore file with BOM
Ensure that we can read and parse an ignore file with a UTF8 BOM.
1 parent c9f116f commit 73a157e

File tree

1 file changed

+23
-0
lines changed

1 file changed

+23
-0
lines changed

tests/status/ignore.c

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1213,3 +1213,26 @@ void test_status_ignore__unignored_subdirs(void)
12131213
assert_is_ignored("dir/a.test");
12141214
refute_is_ignored("dir/subdir/a.test");
12151215
}
1216+
1217+
void test_status_ignore__skips_bom(void)
1218+
{
1219+
static const char *test_files[] = {
1220+
"empty_standard_repo/a.test",
1221+
"empty_standard_repo/b.test",
1222+
"empty_standard_repo/c.test",
1223+
"empty_standard_repo/foo.txt",
1224+
"empty_standard_repo/bar.txt",
1225+
NULL
1226+
};
1227+
1228+
make_test_data("empty_standard_repo", test_files);
1229+
cl_git_mkfile(
1230+
"empty_standard_repo/.gitignore",
1231+
"\xEF\xBB\xBF*.test\n");
1232+
1233+
assert_is_ignored("a.test");
1234+
assert_is_ignored("b.test");
1235+
assert_is_ignored("c.test");
1236+
refute_is_ignored("foo.txt");
1237+
refute_is_ignored("bar.txt");
1238+
}

0 commit comments

Comments
 (0)