]> git.ipfire.org Git - thirdparty/git.git/commit
xdiff: refactor a function
authorPhillip Wood <phillip.wood@dunelm.org.uk>
Wed, 16 Feb 2022 10:15:08 +0000 (10:15 +0000)
committerJunio C Hamano <gitster@pobox.com>
Wed, 16 Feb 2022 18:58:15 +0000 (10:58 -0800)
commit4a37b80e88f8f26a2f56d77c5ad6caa41d572ea8
treebef62ae6302314d5727077ea89d64e5b1f8578c7
parent61f883965f79308b849a55936bee69a33c476c5c
xdiff: refactor a function

Use the standard "goto out" pattern rather than repeating very similar
code after checking for each error. This will simplify the next commit
that starts handling allocation failures that are currently ignored.
On error xdl_do_diff() frees the environment so we need to take care
to avoid a double free in that case. xdl_build_script() does not
assign a result unless it is successful so there is no possibility of
a double free if it fails.

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