From: Tay Ray Chuan Date: Sat, 21 Aug 2010 03:15:25 GMT Subject: Re: [PATCH] builtin/checkout: Fix message when switching to an existing branch Message-ID: In-Reply-To: <1282326107-2139-1-git-send-email-artagnon@gmail.com> On Sat, Aug 21, 2010 at 1:41 AM, Ramkumar Ramachandra 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