fast-rebase: write conflict state to working tree, index, and HEAD
authorElijah Newren <newren@gmail.com>
Thu, 20 May 2021 06:09:32 +0000 (06:09 +0000)
committerJunio C Hamano <gitster@pobox.com>
Thu, 20 May 2021 06:40:39 +0000 (15:40 +0900)
commitf9500261e0aea2bebb527281462d650be1db38a4
tree45ad58db73b05e5943d740bcde5e1564242fcfa1
parentcaba91c373127a316b5442a6aac7080fee9bd624
fast-rebase: write conflict state to working tree, index, and HEAD

Previously, when fast-rebase hit a conflict, it simply aborted and left
HEAD, the index, and the working tree where they were before the
operation started.  While fast-rebase does not support restarting from a
conflicted state, write the conflicted state out anyway as it gives us a
way to see what the conflicts are and write tests that check for them.

This will be important in the upcoming commits, because sequencer.c is
only superficially integrated with merge-ort.c; in particular, it calls
merge_switch_to_result() after EACH merge instead of only calling it at
the end of all the sequence of merges (or when a conflict is hit).  This
not only causes needless updates to the working copy and index, but also
causes all intermediate data to be freed and tossed, preventing caching
information from one merge to the next.  However, integrating
sequencer.c more deeply with merge-ort.c is a big task, and making this
small extension to fast-rebase.c provides us with a simple way to test
the edge and corner cases that we want to make sure continue working.

Signed-off-by: Elijah Newren <newren@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
t/helper/test-fast-rebase.c