Skip to content

Commit ee464c4

Browse files
phillipwoodgitster
authored andcommitted
rebase: cleanup reset_head() calls
If ORIG_HEAD is not set by passing RESET_ORIG_HEAD then there is no need to pass anything for reflog_orig_head. In addition to the callers fixed in this commit move_to_original_branch() also passes reflog_orig_head without setting ORIG_HEAD. That caller is mistakenly passing the message it wants to put in the branch reflog which is not currently possible so we delay fixing that caller until we can pass the message as the branch reflog. A later commit will make it a BUG() to pass reflog_orig_head without RESET_ORIG_HEAD, that changes cannot be done here as it needs to wait for move_to_original_branch() to be fixed first. Signed-off-by: Phillip Wood <[email protected]> Signed-off-by: Junio C Hamano <[email protected]>
1 parent b7de153 commit ee464c4

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

builtin/rebase.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -675,7 +675,7 @@ static int run_am(struct rebase_options *opts)
675675

676676
reset_head(the_repository, &opts->orig_head,
677677
opts->head_name, 0,
678-
"HEAD", NULL, DEFAULT_REFLOG_ACTION);
678+
NULL, NULL, DEFAULT_REFLOG_ACTION);
679679
error(_("\ngit encountered an error while preparing the "
680680
"patches to replay\n"
681681
"these revisions:\n"
@@ -1777,7 +1777,7 @@ int cmd_rebase(int argc, const char **argv, const char *prefix)
17771777
options.head_name ? options.head_name : "detached HEAD",
17781778
oid_to_hex(&options.onto->object.oid));
17791779
reset_head(the_repository, NULL, options.head_name,
1780-
RESET_HEAD_REFS_ONLY, "HEAD", msg.buf, NULL);
1780+
RESET_HEAD_REFS_ONLY, NULL, msg.buf, NULL);
17811781
strbuf_release(&msg);
17821782
ret = finish_rebase(&options);
17831783
goto cleanup;

0 commit comments

Comments
 (0)