Skip to content

Commit a6b4709

Browse files
committed
Merge branch 'ag/rebase-remove-redundant-code'
Code reduction. * ag/rebase-remove-redundant-code: builtin/rebase: remove a call to get_oid() on `options.switch_to'
2 parents b22db26 + 240fc04 commit a6b4709

File tree

1 file changed

+1
-9
lines changed

1 file changed

+1
-9
lines changed

builtin/rebase.c

Lines changed: 1 addition & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -2158,19 +2158,11 @@ int cmd_rebase(int argc, const char **argv, const char *prefix)
21582158
if (!(options.flags & REBASE_FORCE)) {
21592159
/* Lazily switch to the target branch if needed... */
21602160
if (options.switch_to) {
2161-
struct object_id oid;
2162-
2163-
if (get_oid(options.switch_to, &oid) < 0) {
2164-
ret = !!error(_("could not parse '%s'"),
2165-
options.switch_to);
2166-
goto cleanup;
2167-
}
2168-
21692161
strbuf_reset(&buf);
21702162
strbuf_addf(&buf, "%s: checkout %s",
21712163
getenv(GIT_REFLOG_ACTION_ENVIRONMENT),
21722164
options.switch_to);
2173-
if (reset_head(&oid, "checkout",
2165+
if (reset_head(&options.orig_head, "checkout",
21742166
options.head_name,
21752167
RESET_HEAD_RUN_POST_CHECKOUT_HOOK,
21762168
NULL, buf.buf) < 0) {

0 commit comments

Comments
 (0)