Skip to content

Commit 6c0d9e5

Browse files
committed
fixup! builtin rebase: call git am directly
In the scripted version, we call `move_to_original_branch`, which updates `HEAD` to point to the original branch again, after updating that branch to point at the current commit. This does not require any worktree update. In the built-in version, we tried to reuse the `reset_head()` function, which however does try to update the worktree. Of course, as there are no changes, no actual worktree updates are performed. However, with an insanely large repository, even just looking whether we need to write anything takes a noticeable time. So let's avoid that in the built-in version, too. Signed-off-by: Johannes Schindelin <[email protected]>
1 parent e61d695 commit 6c0d9e5

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

builtin/rebase.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -505,7 +505,8 @@ static int move_to_original_branch(struct rebase_options *opts)
505505
opts->head_name, oid_to_hex(&opts->onto->object.oid));
506506
strbuf_addf(&head_reflog, "rebase finished: returning to %s",
507507
opts->head_name);
508-
ret = reset_head(NULL, "checkout", opts->head_name, 0,
508+
ret = reset_head(NULL, "checkout", opts->head_name,
509+
RESET_HEAD_REFS_ONLY,
509510
orig_head_reflog.buf, head_reflog.buf);
510511

511512
strbuf_release(&orig_head_reflog);

0 commit comments

Comments
 (0)