Nguyễn Thái Ngọc Duy | c5ae7cb | 2009-05-07 00:33:34 +1000 | [diff] [blame] | 1 | #!/bin/sh |
Jim Meyering | a624eaa | 2008-08-15 13:39:26 +0200 | [diff] [blame] | 2 | # |
| 3 | # Copyright (c) Jim Meyering |
| 4 | # |
Johannes Schindelin | 950db87 | 2009-01-20 22:08:33 +0100 | [diff] [blame] | 5 | test_description='diff honors config option, diff.suppressBlankEmpty' |
Jim Meyering | a624eaa | 2008-08-15 13:39:26 +0200 | [diff] [blame] | 6 | |
| 7 | . ./test-lib.sh |
| 8 | |
| 9 | cat <<\EOF > exp || |
| 10 | diff --git a/f b/f |
| 11 | index 5f6a263..8cb8bae 100644 |
| 12 | --- a/f |
| 13 | +++ b/f |
| 14 | @@ -1,2 +1,2 @@ |
| 15 | |
| 16 | -x |
| 17 | +y |
| 18 | EOF |
| 19 | exit 1 |
| 20 | |
| 21 | test_expect_success \ |
| 22 | "$test_description" \ |
| 23 | 'printf "\nx\n" > f && |
| 24 | git add f && |
| 25 | git commit -q -m. f && |
| 26 | printf "\ny\n" > f && |
Johannes Schindelin | 950db87 | 2009-01-20 22:08:33 +0100 | [diff] [blame] | 27 | git config --bool diff.suppressBlankEmpty true && |
Jim Meyering | a624eaa | 2008-08-15 13:39:26 +0200 | [diff] [blame] | 28 | git diff f > actual && |
| 29 | test_cmp exp actual && |
Junio C Hamano | 7096b64 | 2012-06-12 09:49:59 -0700 | [diff] [blame] | 30 | "$PERL_PATH" -i.bak -p -e "s/^\$/ /" exp && |
Johannes Schindelin | 950db87 | 2009-01-20 22:08:33 +0100 | [diff] [blame] | 31 | git config --bool diff.suppressBlankEmpty false && |
Jim Meyering | a624eaa | 2008-08-15 13:39:26 +0200 | [diff] [blame] | 32 | git diff f > actual && |
| 33 | test_cmp exp actual && |
Johannes Schindelin | 950db87 | 2009-01-20 22:08:33 +0100 | [diff] [blame] | 34 | git config --bool --unset diff.suppressBlankEmpty && |
Jim Meyering | a624eaa | 2008-08-15 13:39:26 +0200 | [diff] [blame] | 35 | git diff f > actual && |
| 36 | test_cmp exp actual |
| 37 | ' |
| 38 | |
| 39 | test_done |