]> git.ipfire.org Git - thirdparty/git.git/commit - merge-recursive.c
merge-recursive: enforce opt->ancestor != NULL when calling merge_trees()
authorElijah Newren <newren@gmail.com>
Thu, 15 Aug 2019 21:40:32 +0000 (14:40 -0700)
committerJunio C Hamano <gitster@pobox.com>
Fri, 16 Aug 2019 19:47:20 +0000 (12:47 -0700)
commit139ef37a2f4daf2071debeca8b2115b4e4b0a33f
treebe14e0863d5af8089936f191fa8da46c23ca1c56
parent65c01c644250fb0a92f929c2fc61f33771bf480f
merge-recursive: enforce opt->ancestor != NULL when calling merge_trees()

We always want our conflict hunks to be labelled so that users can know
where each came from.  The previous commit fixed the one caller in the
codebase which was not setting opt->ancestor (and thus not providing a
label for the "merge base" conflict hunk in diff3-style conflict
markers); add an assertion to prevent future codepaths from also
overlooking this requirement.

Enforcing this requirement also allows us to simplify the code for
labelling the conflict hunks by no longer checking if the ancestor label
is NULL.

Signed-off-by: Elijah Newren <newren@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
merge-recursive.c