diff options
author | Junio C Hamano <gitster@pobox.com> | 2016-10-04 15:26:27 -0700 |
---|---|---|
committer | Junio C Hamano <gitster@pobox.com> | 2016-10-04 15:49:05 -0700 |
commit | a17505f262b62e429bb0e188c5ed73ac749e25b8 (patch) | |
tree | f50696174df4b24ce70883b4d89b301edb10215e /t/t4015-diff-whitespace.sh | |
parent | 0b4b42e7fe1b507fb387c18d9a2748768359bf5d (diff) | |
download | git-a17505f262b62e429bb0e188c5ed73ac749e25b8.tar.gz git-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/t4015-diff-whitespace.sh')
-rwxr-xr-x | t/t4015-diff-whitespace.sh | 35 |
1 files changed, 35 insertions, 0 deletions
diff --git a/t/t4015-diff-whitespace.sh b/t/t4015-diff-whitespace.sh index 4a4f37482..289806d0c 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 |