]> git.ipfire.org Git - thirdparty/git.git/blame - t/t4029-diff-trailing-space.sh
wildmatch: rename constants and update prototype
[thirdparty/git.git] / t / t4029-diff-trailing-space.sh
CommitLineData
c5ae7cb6 1#!/bin/sh
a624eaa7
JM
2#
3# Copyright (c) Jim Meyering
4#
950db879 5test_description='diff honors config option, diff.suppressBlankEmpty'
a624eaa7
JM
6
7. ./test-lib.sh
8
9cat <<\EOF > exp ||
10diff --git a/f b/f
11index 5f6a263..8cb8bae 100644
12--- a/f
13+++ b/f
14@@ -1,2 +1,2 @@
15
16-x
17+y
18EOF
19exit 1
20
21test_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 &&
950db879 27 git config --bool diff.suppressBlankEmpty true &&
a624eaa7
JM
28 git diff f > actual &&
29 test_cmp exp actual &&
7096b648 30 "$PERL_PATH" -i.bak -p -e "s/^\$/ /" exp &&
950db879 31 git config --bool diff.suppressBlankEmpty false &&
a624eaa7
JM
32 git diff f > actual &&
33 test_cmp exp actual &&
950db879 34 git config --bool --unset diff.suppressBlankEmpty &&
a624eaa7
JM
35 git diff f > actual &&
36 test_cmp exp actual
37 '
38
39test_done