Merge branch 'cn/bom-in-gitignore'
Teach the codepaths that read .gitignore and .gitattributes files that these files encoded in UTF-8 may have UTF-8 BOM marker at the beginning; this makes it in line with what we do for configuration files already. * cn/bom-in-gitignore: attr: skip UTF8 BOM at the beginning of the input file config: use utf8_bom[] from utf.[ch] in git_parse_source() utf8-bom: introduce skip_utf8_bom() helper add_excludes_from_file: clarify the bom skipping logic dir: allow a BOM at the beginning of exclude files
This commit is contained in:
@ -20,6 +20,15 @@ test_expect_success 'status untracked directory with --ignored' '
|
||||
test_cmp expected actual
|
||||
'
|
||||
|
||||
test_expect_success 'same with gitignore starting with BOM' '
|
||||
printf "\357\273\277ignored\n" >.gitignore &&
|
||||
mkdir -p untracked &&
|
||||
: >untracked/ignored &&
|
||||
: >untracked/uncommitted &&
|
||||
git status --porcelain --ignored >actual &&
|
||||
test_cmp expected actual
|
||||
'
|
||||
|
||||
cat >expected <<\EOF
|
||||
?? .gitignore
|
||||
?? actual
|
||||
|
Reference in New Issue
Block a user