2009-05-06 16:33:34 +02:00
|
|
|
#!/bin/sh
|
2008-08-15 13:39:26 +02:00
|
|
|
#
|
|
|
|
# Copyright (c) Jim Meyering
|
|
|
|
#
|
2009-01-20 22:08:33 +01:00
|
|
|
test_description='diff honors config option, diff.suppressBlankEmpty'
|
2008-08-15 13:39:26 +02:00
|
|
|
|
|
|
|
. ./test-lib.sh
|
|
|
|
|
|
|
|
cat <<\EOF > exp ||
|
|
|
|
diff --git a/f b/f
|
|
|
|
index 5f6a263..8cb8bae 100644
|
|
|
|
--- a/f
|
|
|
|
+++ b/f
|
|
|
|
@@ -1,2 +1,2 @@
|
|
|
|
|
|
|
|
-x
|
|
|
|
+y
|
|
|
|
EOF
|
|
|
|
exit 1
|
|
|
|
|
|
|
|
test_expect_success \
|
|
|
|
"$test_description" \
|
|
|
|
'printf "\nx\n" > f &&
|
|
|
|
git add f &&
|
|
|
|
git commit -q -m. f &&
|
|
|
|
printf "\ny\n" > f &&
|
2009-01-20 22:08:33 +01:00
|
|
|
git config --bool diff.suppressBlankEmpty true &&
|
2008-08-15 13:39:26 +02:00
|
|
|
git diff f > actual &&
|
|
|
|
test_cmp exp actual &&
|
2012-06-12 18:49:59 +02:00
|
|
|
"$PERL_PATH" -i.bak -p -e "s/^\$/ /" exp &&
|
2009-01-20 22:08:33 +01:00
|
|
|
git config --bool diff.suppressBlankEmpty false &&
|
2008-08-15 13:39:26 +02:00
|
|
|
git diff f > actual &&
|
|
|
|
test_cmp exp actual &&
|
2009-01-20 22:08:33 +01:00
|
|
|
git config --bool --unset diff.suppressBlankEmpty &&
|
2008-08-15 13:39:26 +02:00
|
|
|
git diff f > actual &&
|
|
|
|
test_cmp exp actual
|
|
|
|
'
|
|
|
|
|
|
|
|
test_done
|