]> git.ipfire.org Git - thirdparty/git.git/commit - merge-ort.c
merge-ort: add implementation of record_conflicted_index_entries()
authorElijah Newren <newren@gmail.com>
Sun, 13 Dec 2020 08:04:26 +0000 (08:04 +0000)
committerJunio C Hamano <gitster@pobox.com>
Sun, 13 Dec 2020 22:18:20 +0000 (14:18 -0800)
commitef2b369387004f4f11497a55174d0d9859549054
tree0882bc79a8b7c8e18a2a77ca8149490e5dc0ac5f
parent70912f66de751b2f1af145887dc64c9c0d06de36
merge-ort: add implementation of record_conflicted_index_entries()

After checkout(), the working tree has the appropriate contents, and the
index matches the working copy.  That means that all unmodified and
cleanly merged files have correct index entries, but conflicted entries
need to be updated.

We do this by looping over the conflicted entries, marking the existing
index entry for the path with CE_REMOVE, adding new higher order staged
for the path at the end of the index (ignoring normal index sort order),
and then at the end of the loop removing the CE_REMOVED-marked cache
entries and sorting the index.

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