Skip to content

Commit fb91588

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. Signed-off-by: Phillip Wood <[email protected]> Signed-off-by: Junio C Hamano <[email protected]>
1 parent 0ab6c01 commit fb91588

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
@@ -883,7 +883,7 @@ static int run_am(struct rebase_options *opts)
883883

884884
reset_head(the_repository, &opts->orig_head,
885885
opts->head_name, 0,
886-
"HEAD", NULL, DEFAULT_REFLOG_ACTION);
886+
NULL, NULL, DEFAULT_REFLOG_ACTION);
887887
error(_("\ngit encountered an error while preparing the "
888888
"patches to replay\n"
889889
"these revisions:\n"
@@ -2087,7 +2087,7 @@ int cmd_rebase(int argc, const char **argv, const char *prefix)
20872087
options.head_name ? options.head_name : "detached HEAD",
20882088
oid_to_hex(&options.onto->object.oid));
20892089
reset_head(the_repository, NULL, options.head_name,
2090-
RESET_HEAD_REFS_ONLY, "HEAD", msg.buf, NULL);
2090+
RESET_HEAD_REFS_ONLY, NULL, msg.buf, NULL);
20912091
strbuf_release(&msg);
20922092
ret = finish_rebase(&options);
20932093
goto cleanup;

0 commit comments

Comments
 (0)