]>
Commit | Line | Data |
---|---|---|
c5ae7cb6 | 1 | #!/bin/sh |
a624eaa7 JM |
2 | # |
3 | # Copyright (c) Jim Meyering | |
4 | # | |
950db879 | 5 | test_description='diff honors config option, diff.suppressBlankEmpty' |
a624eaa7 | 6 | |
16d4bd4f | 7 | TEST_PASSES_SANITIZE_LEAK=true |
a624eaa7 JM |
8 | . ./test-lib.sh |
9 | ||
b55ee572 | 10 | cat <<\EOF >expected || |
a624eaa7 JM |
11 | diff --git a/f b/f |
12 | index 5f6a263..8cb8bae 100644 | |
13 | --- a/f | |
14 | +++ b/f | |
15 | @@ -1,2 +1,2 @@ | |
16 | ||
17 | -x | |
18 | +y | |
19 | EOF | |
20 | exit 1 | |
21 | ||
7022ba33 | 22 | test_expect_success "$test_description" ' |
23 | printf "\nx\n" > f && | |
b55ee572 | 24 | before=$(git hash-object f) && |
25 | before=$(git rev-parse --short $before) && | |
7022ba33 | 26 | git add f && |
27 | git commit -q -m. f && | |
28 | printf "\ny\n" > f && | |
b55ee572 | 29 | after=$(git hash-object f) && |
30 | after=$(git rev-parse --short $after) && | |
31 | sed -e "s/^index .*/index $before..$after 100644/" expected >exp && | |
7022ba33 | 32 | git config --bool diff.suppressBlankEmpty true && |
33 | git diff f > actual && | |
34 | test_cmp exp actual && | |
35 | perl -i.bak -p -e "s/^\$/ /" exp && | |
36 | git config --bool diff.suppressBlankEmpty false && | |
37 | git diff f > actual && | |
38 | test_cmp exp actual && | |
39 | git config --bool --unset diff.suppressBlankEmpty && | |
40 | git diff f > actual && | |
41 | test_cmp exp actual | |
42 | ' | |
a624eaa7 JM |
43 | |
44 | test_done |