summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJunio C Hamano <gitster@pobox.com>2020-03-05 18:43:04 (GMT)
committerJunio C Hamano <gitster@pobox.com>2020-03-05 18:43:04 (GMT)
commita6b4709302311634a77da8074362475224f6504d (patch)
treea8c8e029ff3e00d1749f2d2abe05e566fae846a4
parentb22db265d6bde72391c8d47700dc781a3ea2ae41 (diff)
parent240fc04f81fcc6c646ec08bfab4662bb09e44c50 (diff)
downloadgit-a6b4709302311634a77da8074362475224f6504d.zip
git-a6b4709302311634a77da8074362475224f6504d.tar.gz
git-a6b4709302311634a77da8074362475224f6504d.tar.bz2
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'
-rw-r--r--builtin/rebase.c10
1 files changed, 1 insertions, 9 deletions
diff --git a/builtin/rebase.c b/builtin/rebase.c
index 7bff0c8..cb7aeae 100644
--- a/builtin/rebase.c
+++ b/builtin/rebase.c
@@ -2158,19 +2158,11 @@ int cmd_rebase(int argc, const char **argv, const char *prefix)
if (!(options.flags & REBASE_FORCE)) {
/* Lazily switch to the target branch if needed... */
if (options.switch_to) {
- struct object_id oid;
-
- if (get_oid(options.switch_to, &oid) < 0) {
- ret = !!error(_("could not parse '%s'"),
- options.switch_to);
- goto cleanup;
- }
-
strbuf_reset(&buf);
strbuf_addf(&buf, "%s: checkout %s",
getenv(GIT_REFLOG_ACTION_ENVIRONMENT),
options.switch_to);
- if (reset_head(&oid, "checkout",
+ if (reset_head(&options.orig_head, "checkout",
options.head_name,
RESET_HEAD_RUN_POST_CHECKOUT_HOOK,
NULL, buf.buf) < 0) {