From: Tay Ray Chuan <rctay89@gmail.com>
To: Ramkumar Ramachandra <artagnon@gmail.com>
Cc: Git Mailing List <git@vger.kernel.org>,
Junio C Hamano <gitster@pobox.com>
Subject: Re: [PATCH] builtin/checkout: Fix message when switching to an existing branch
Date: Sat, 21 Aug 2010 11:15:25 +0800 [thread overview]
Message-ID: <AANLkTim4K7LnZOhGQUNwpLR24Hm+V1fWrxY2UE2oPGx7@mail.gmail.com> (raw)
In-Reply-To: <1282326107-2139-1-git-send-email-artagnon@gmail.com>
On Sat, Aug 21, 2010 at 1:41 AM, Ramkumar Ramachandra
<artagnon@gmail.com> wrote:
> builtin/checkout.c | 5 ++++-
> 1 files changed, 4 insertions(+), 1 deletions(-)
>
> diff --git a/builtin/checkout.c b/builtin/checkout.c
> index 156900d..ff5ac1e 100644
> --- a/builtin/checkout.c
> +++ b/builtin/checkout.c
> @@ -545,10 +545,13 @@ static void update_refs_for_switch(struct checkout_opts *opts,
> if (old->path && !strcmp(new->path, old->path))
> fprintf(stderr, "Already on '%s'\n",
> new->name);
> - else
> + else if (opts->new_branch)
> fprintf(stderr, "Switched to%s branch '%s'\n",
> opts->branch_exists ? " and reset" : " a new",
> new->name);
> + else
> + fprintf(stderr, "Switched to branch '%s'\n",
> + new->name);
On a closer reading, I realise that "reset" isn't mentioned if the
branch exists.
The terser ternary version doesn't suffer from this defect.
--
Cheers,
Ray Chuan
next prev parent reply other threads:[~2010-08-21 3:15 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2010-08-20 17:41 [PATCH] builtin/checkout: Fix message when switching to an existing branch Ramkumar Ramachandra
2010-08-20 17:46 ` Tay Ray Chuan
2010-08-20 17:49 ` Ramkumar Ramachandra
2010-08-20 18:17 ` Junio C Hamano
2010-08-21 3:15 ` Tay Ray Chuan [this message]
2010-08-21 3:28 ` Tay Ray Chuan
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=AANLkTim4K7LnZOhGQUNwpLR24Hm+V1fWrxY2UE2oPGx7@mail.gmail.com \
--to=rctay89@gmail.com \
--cc=artagnon@gmail.com \
--cc=git@vger.kernel.org \
--cc=gitster@pobox.com \
/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).