]> git.ipfire.org Git - thirdparty/git.git/commit
diff --color-moved: stop clearing potential moved blocks
authorPhillip Wood <phillip.wood@dunelm.org.uk>
Thu, 9 Dec 2021 10:30:06 +0000 (10:30 +0000)
committerJunio C Hamano <gitster@pobox.com>
Thu, 9 Dec 2021 21:24:06 +0000 (13:24 -0800)
commiteec7f53b3150dcc54ea0f4441587724be65c105d
tree1f9d91006dc430404028f04f6b45cef6df99df52
parent0e488f173257e5ab766267ac5a5c4c9f3f1ce343
diff --color-moved: stop clearing potential moved blocks

moved_block_clear() was introduced in 74d156f4a1 ("diff
--color-moved-ws: fix double free crash", 2018-10-04) to free the
memory that was allocated when initializing a potential moved
block. However since 21536d077f ("diff --color-moved-ws: modify
allow-indentation-change", 2018-11-23) initializing a potential moved
block no longer allocates any memory. Up until the last commit we were
relying on moved_block_clear() to set the `match` pointer to NULL when
a block stopped matching, but since that commit we do not clear a
moved block that does not match so it does not make sense to clear
them elsewhere.

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