]> git.ipfire.org Git - thirdparty/git.git/commit
rebase -i: remove patch file after conflict resolution
authorPhillip Wood <phillip.wood@dunelm.org.uk>
Wed, 6 Sep 2023 15:22:46 +0000 (15:22 +0000)
committerJunio C Hamano <gitster@pobox.com>
Wed, 6 Sep 2023 17:29:43 +0000 (10:29 -0700)
commit206a78d710853eaed97ab50ba336789e6b3499c7
tree76d2d2872e13fce87b6bd5e530b57c31ff23683b
parent36ac861a305720c54f759da814647d5987beb10b
rebase -i: remove patch file after conflict resolution

When a rebase stops for the user to resolve conflicts it writes a patch
for the conflicting commit to .git/rebase-merge/patch. This file has
been written since the introduction of "git-rebase-interactive.sh" in
1b1dce4bae7 (Teach rebase an interactive mode, 2007-06-25). I assume the
idea was to enable the user inspect the conflicting commit in the same
way as they could for the patch based rebase. This file should be
deleted when the rebase continues as if the rebase stops for a failed
"exec" command or a "break" command it is confusing to the user if there
is a stale patch lying around from an unrelated command. As the path is
now used in two different places rebase_path_patch() is added and used
to obtain the path for the patch.

To construct the path write_patch() previously used get_dir() which
returns different paths depending on whether we're rebasing or
cherry-picking/reverting. As this function is only called when
rebasing it is safe to use a hard coded string for the directory
instead. An assertion is added to make sure we don't starting calling
this function when cherry-picking in the future.

Signed-off-by: Phillip Wood <phillip.wood@dunelm.org.uk>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
sequencer.c
t/t3418-rebase-continue.sh