@@ -64,6 +64,12 @@ check_zip() {
6464 test_cmp_bin $original /nodiff.crlf $extracted /nodiff.crlf &&
6565 test_cmp_bin $original /nodiff.lf $extracted /nodiff.lf
6666 "
67+
68+ test_expect_success UNZIP " validate that custom diff is unchanged " "
69+ test_cmp_bin $original /custom.cr $extracted /custom.cr &&
70+ test_cmp_bin $original /custom.crlf $extracted /custom.crlf &&
71+ test_cmp_bin $original /custom.lf $extracted /custom.lf
72+ "
6773}
6874
6975test_expect_success \
@@ -78,6 +84,9 @@ test_expect_success \
7884 printf "text\r" >a/nodiff.cr &&
7985 printf "text\r\n" >a/nodiff.crlf &&
8086 printf "text\n" >a/nodiff.lf &&
87+ printf "text\r" >a/custom.cr &&
88+ printf "text\r\n" >a/custom.crlf &&
89+ printf "text\n" >a/custom.lf &&
8190 printf "\0\r" >a/binary.cr &&
8291 printf "\0\r\n" >a/binary.crlf &&
8392 printf "\0\n" >a/binary.lf &&
@@ -112,15 +121,20 @@ test_expect_success 'add files to repository' '
112121test_expect_success ' setup export-subst and diff attributes' '
113122 echo "a/nodiff.* -diff" >>.git/info/attributes &&
114123 echo "a/diff.* diff" >>.git/info/attributes &&
124+ echo "a/custom.* diff=custom" >>.git/info/attributes &&
125+ git config diff.custom.binary true &&
115126 echo "substfile?" export-subst >>.git/info/attributes &&
116127 git log --max-count=1 "--pretty=format:A${SUBSTFORMAT}O" HEAD \
117128 >a/substfile1
118129'
119130
120- test_expect_success \
121- ' create bare clone' \
122- ' git clone --bare . bare.git &&
123- cp .git/info/attributes bare.git/info/attributes'
131+ test_expect_success ' create bare clone' '
132+ git clone --bare . bare.git &&
133+ cp .git/info/attributes bare.git/info/attributes &&
134+ # Recreate our changes to .git/config rather than just copying it, as
135+ # we do not want to clobber core.bare or other settings.
136+ git -C bare.git config diff.custom.binary true
137+ '
124138
125139test_expect_success \
126140 ' remove ignored file' \
0 commit comments