From: Johannes Schindelin <Johannes.Schindelin@gmx.de>
To: Alban Gruin <alban.gruin@gmail.com>
Cc: git@vger.kernel.org, phillip.wood@dunelm.org.uk,
Junio C Hamano <gitster@pobox.com>
Subject: Re: [PATCH v1] builtin/rebase: remove a call to get_oid() on `options.switch_to'
Date: Wed, 22 Jan 2020 15:00:44 +0100 (CET) [thread overview]
Message-ID: <nycvar.QRO.7.76.6.2001221500210.46@tvgsbejvaqbjf.bet> (raw)
In-Reply-To: <20200121193226.24297-1-alban.gruin@gmail.com>
Hi Alban,
On Tue, 21 Jan 2020, Alban Gruin wrote:
> When `options.switch_to' is set, `options.orig_head' is populated right
> after. Therefore, there is no need to parse `switch_to' again.
>
> Signed-off-by: Alban Gruin <alban.gruin@gmail.com>
ACK!
Dscho
> ---
> builtin/rebase.c | 10 +---------
> 1 file changed, 1 insertion(+), 9 deletions(-)
>
> diff --git a/builtin/rebase.c b/builtin/rebase.c
> index 6154ad8fa5..16d2ec7ebc 100644
> --- a/builtin/rebase.c
> +++ b/builtin/rebase.c
> @@ -2056,19 +2056,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) {
> --
> 2.24.1
>
>
next prev parent reply other threads:[~2020-01-22 14:01 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-01-21 19:32 [PATCH v1] builtin/rebase: remove a call to get_oid() on `options.switch_to' Alban Gruin
2020-01-22 14:00 ` Johannes Schindelin [this message]
2020-01-22 20:47 ` Junio C Hamano
2020-02-14 20:43 ` Alban Gruin
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=nycvar.QRO.7.76.6.2001221500210.46@tvgsbejvaqbjf.bet \
--to=johannes.schindelin@gmx.de \
--cc=alban.gruin@gmail.com \
--cc=git@vger.kernel.org \
--cc=gitster@pobox.com \
--cc=phillip.wood@dunelm.org.uk \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).