summaryrefslogtreecommitdiff
path: root/builtin/checkout.c
diff options
context:
space:
mode:
Diffstat (limited to 'builtin/checkout.c')
-rw-r--r--builtin/checkout.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/builtin/checkout.c b/builtin/checkout.c
index 1f7e154..7f81120 100644
--- a/builtin/checkout.c
+++ b/builtin/checkout.c
@@ -533,10 +533,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);
}
if (old->path && old->name) {
char log_file[PATH_MAX], ref_file[PATH_MAX];