path: root/tests
diff options
authorIan Jackson <>2018-06-20 13:31:36 +0100
committerIan Jackson <>2018-06-20 14:29:38 +0100
commit37dc8e5f1c9aec0d5b517a36ab465fc6c64155db (patch)
treea8cef413ec6a0c6bcaeacb9ec1150fd34c53b01b /tests
parent8417abd83a6d2659bd556476ddee0a232d579eca (diff)
test suite: gitattributes: Test working-tree-encoding suppression
Put a UTF-8 BOM in the middle of the test files, and some gitattribute settings for working-tree-encoding. `ISO-8859-1' produces file corruption. `UTF-16' produces an error since it doesn't specify BE or LE, and the file lacks a BOM at the start. Part of the fix to #901900. This introduces the desired test failure. Signed-off-by: Ian Jackson <>
Diffstat (limited to 'tests')
1 files changed, 2 insertions, 0 deletions
diff --git a/tests/tests/gitattributes b/tests/tests/gitattributes
index 9e1c246..5be7d01 100755
--- a/tests/tests/gitattributes
+++ b/tests/tests/gitattributes
@@ -22,6 +22,7 @@ badattr1 () {
printf >>af/$filename 'crlf: \r\n'
echo >>af/$filename 'id $Id: $'
echo >>af/$filename 'id $Id: SPLARK $'
+ printf >>af/$filename '\xEF\xBB\xBF <- UTF-8 BOM\n'
echo >>gitattrs "af/$filename" "$attrspec"
@@ -57,6 +58,7 @@ badattr export-ignore
badattr export-subst
badattr delta
badattr encoding no-such-encoding
+badattr working-tree-encoding ISO-8859-1 UTF-16
man gitattributes \
| perl -ne 'print $1,"\n" if m/^ *(\w[-a-z]*)$/' \