Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.kernel.org/pub/scm/git/git.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRamkumar Ramachandra <artagnon@gmail.com>2010-08-20 21:41:47 +0400
committerJunio C Hamano <gitster@pobox.com>2010-08-20 22:17:28 +0400
commit09a0ec58ce57413dcb2b2cfb4b4ece11ad616e7b (patch)
tree2220928be55641b1a93d8d54fab6ff82712c4660 /builtin
parentc11969de93e741ae42d1d1d60ce716de6cf5e22b (diff)
builtin/checkout: Fix message when switching to an existing branch
Fix "Switched to a new branch <name>" to read "Switched to branch <name>" when <name> corresponds to an existing branch. This bug was introduced in 02ac983 while introducing the `-B` switch. Cc: Tay Ray Chuan <rctay89@gmail.com> Signed-off-by: Ramkumar Ramachandra <artagnon@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 'builtin')
-rw-r--r--builtin/checkout.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/builtin/checkout.c b/builtin/checkout.c
index 1f7e1546f6..7f81120c72 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];