]> git.ipfire.org Git - thirdparty/git.git/commit - diff.c
diff: fix --color-moved-ws=allow-indentation-change
authorPhillip Wood <phillip.wood@dunelm.org.uk>
Tue, 4 Sep 2018 13:52:58 +0000 (14:52 +0100)
committerJunio C Hamano <gitster@pobox.com>
Tue, 11 Sep 2018 20:40:49 +0000 (13:40 -0700)
commitfab01ec52e83df886ca952879e196b8d8bd42013
treeaec69101dfd395a83499db0aae1fc2ac905f47a3
parent626c0b5d395196ddabcf9b9a430db385722689d4
diff: fix --color-moved-ws=allow-indentation-change

If there is more than one potential moved block and the longest block
is not the first element of the array of potential blocks then the
block is cut short. With --color-moved=blocks this can leave moved
lines unpainted if the shortened block does not meet the block length
requirement. With --color-moved=zebra then in addition to the
unpainted lines the moved color can change in the middle of a single
block.

Fix this by freeing the whitespace delta of the match we're discarding
rather than the one we're keeping.

Signed-off-by: Phillip Wood <phillip.wood@dunelm.org.uk>
Acked-by: Stefan Beller <sbeller@google.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
diff.c