@@ -1811,19 +1811,10 @@ int cmd_rebase(int argc, const char **argv, const char *prefix)
* If the onto is a proper descendant of the tip of the branch, then
* we just fast-forwarded.
*/
- strbuf_reset(&msg);
if (oideq(&branch_base, &options.orig_head->object.oid)) {
printf(_("Fast-forwarded %s to %s.\n"),
branch_name, options.onto_name);
- strbuf_addf(&msg, "rebase finished: %s onto %s",
- options.head_name ? options.head_name : "detached HEAD",
- oid_to_hex(&options.onto->object.oid));
- memset(&ropts, 0, sizeof(ropts));
- ropts.branch = options.head_name;
- ropts.flags = RESET_HEAD_REFS_ONLY;
- ropts.head_msg = msg.buf;
- reset_head(the_repository, &ropts);
- strbuf_release(&msg);
+ move_to_original_branch(&options);
ret = finish_rebase(&options);
goto cleanup;
}
@@ -143,14 +143,8 @@ test_reflog () {
) &&
git log -g --format=%gs -2 >actual &&
- if test "$mode" = "--apply"
- then
- finish_msg="refs/heads/fast-forward onto $(git rev-parse main)"
- else
- finish_msg="returning to refs/heads/fast-forward"
- fi &&
write_reflog_expect <<-EOF &&
- ${reflog_action:-rebase} (finish): $finish_msg
+ ${reflog_action:-rebase} (finish): returning to refs/heads/fast-forward
${reflog_action:-rebase} (start): checkout main
EOF
test_cmp expect actual &&