From b0a2ba47761fa7bffb5a33e5a76f85da50a00ba5 Mon Sep 17 00:00:00 2001 From: Phillip Wood Date: Fri, 23 Nov 2018 11:16:55 +0000 Subject: diff --color-moved=zebra: be stricter with color alternation Currently when using --color-moved=zebra the color of moved blocks depends on the number of lines separating them. This means that adding an odd number of unmoved lines between blocks that are already separated by one or more unmoved lines will change the color of subsequent moved blocks. This does not make much sense as the blocks were already separated by unmoved lines and causes problems when adding lines to test cases. Fix this by only using the alternate colors for adjacent moved blocks. Signed-off-by: Phillip Wood Reviewed-by: Stefan Beller Signed-off-by: Junio C Hamano --- t/t4015-diff-whitespace.sh | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 't') diff --git a/t/t4015-diff-whitespace.sh b/t/t4015-diff-whitespace.sh index eee81a1987..fe8a2ab06e 100755 --- a/t/t4015-diff-whitespace.sh +++ b/t/t4015-diff-whitespace.sh @@ -1802,14 +1802,14 @@ test_expect_success 'only move detection ignores white spaces' ' -a long line to exceed per-line minimum -another long line to exceed per-line minimum -original file - +Qa long line to exceed per-line minimum - +Qanother long line to exceed per-line minimum + +Qa long line to exceed per-line minimum + +Qanother long line to exceed per-line minimum +new file EOF test_cmp expected actual ' -test_expect_failure 'compare whitespace delta across moved blocks' ' +test_expect_success 'compare whitespace delta across moved blocks' ' git reset --hard && q_to_tab <<-\EOF >text.txt && -- cgit v1.3-6-g1900