summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: c11969d)
raw | patch | inline | side by side (parent: c11969d)
author | Ramkumar Ramachandra <artagnon@gmail.com> | |
Fri, 20 Aug 2010 17:41:47 +0000 (23:11 +0530) | ||
committer | Junio C Hamano <gitster@pobox.com> | |
Fri, 20 Aug 2010 18:17:28 +0000 (11:17 -0700) |
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>
<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>
builtin/checkout.c | patch | blob | history |
diff --git a/builtin/checkout.c b/builtin/checkout.c
index 1f7e1546f69acaef5e3c5cca1476acec972cb334..7f81120c728dce6fe712280f40583925eda264e3 100644 (file)
--- a/builtin/checkout.c
+++ b/builtin/checkout.c
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];