From a17505f262b62e429bb0e188c5ed73ac749e25b8 Mon Sep 17 00:00:00 2001 From: Junio C Hamano Date: Tue, 4 Oct 2016 15:26:27 -0700 Subject: 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 --- t/t4015-diff-whitespace.sh | 35 +++++++++++++++++++++++++++++++++++ 1 file changed, 35 insertions(+) (limited to 't') 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 -- cgit v1.2.3