summaryrefslogtreecommitdiff
path: root/t
diff options
context:
space:
mode:
authorLibravatar Junio C Hamano <gitster@pobox.com>2016-10-04 15:26:27 -0700
committerLibravatar Junio C Hamano <gitster@pobox.com>2016-10-04 15:49:05 -0700
commita17505f262b62e429bb0e188c5ed73ac749e25b8 (patch)
treef50696174df4b24ce70883b4d89b301edb10215e /t
parentdiff.c: move ws-error-highlight parsing helpers up (diff)
downloadtgif-a17505f262b62e429bb0e188c5ed73ac749e25b8.tar.xz
diff: introduce diff.wsErrorHighlight option
With the preparatory steps, it has become trivial to teach the system a new diff.wsErrorHighlight configuration that gives the default value for --ws-error-highlight command line option. Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 't')
-rwxr-xr-xt/t4015-diff-whitespace.sh35
1 files changed, 35 insertions, 0 deletions
diff --git a/t/t4015-diff-whitespace.sh b/t/t4015-diff-whitespace.sh
index 4a4f374824..289806d0c7 100755
--- a/t/t4015-diff-whitespace.sh
+++ b/t/t4015-diff-whitespace.sh
@@ -937,4 +937,39 @@ test_expect_success 'test --ws-error-highlight option' '
'
+test_expect_success 'test diff.wsErrorHighlight config' '
+
+ git -c color.diff=always -c diff.wsErrorHighlight=default,old diff |
+ test_decode_color >current &&
+ test_cmp expect.default-old current &&
+
+ git -c color.diff=always -c diff.wsErrorHighlight=all diff |
+ test_decode_color >current &&
+ test_cmp expect.all current &&
+
+ git -c color.diff=always -c diff.wsErrorHighlight=none diff |
+ test_decode_color >current &&
+ test_cmp expect.none current
+
+'
+
+test_expect_success 'option overrides diff.wsErrorHighlight' '
+
+ git -c color.diff=always -c diff.wsErrorHighlight=none \
+ diff --ws-error-highlight=default,old |
+ test_decode_color >current &&
+ test_cmp expect.default-old current &&
+
+ git -c color.diff=always -c diff.wsErrorHighlight=default \
+ diff --ws-error-highlight=all |
+ test_decode_color >current &&
+ test_cmp expect.all current &&
+
+ git -c color.diff=always -c diff.wsErrorHighlight=all \
+ diff --ws-error-highlight=none |
+ test_decode_color >current &&
+ test_cmp expect.none current
+
+'
+
test_done