summaryrefslogtreecommitdiff
path: root/branch.c
diff options
context:
space:
mode:
authorConrad Irwin <conrad.irwin@gmail.com>2011-08-20 14:49:49 -0700
committerJunio C Hamano <gitster@pobox.com>2011-08-22 16:03:43 -0700
commit587a9ee7da348f5e6696720d770d0e0da597827c (patch)
treea5d378daeaec78a7d513056071b78c419b0ed515 /branch.c
parent55c4a673070f40f2ef12d0be269e95f1df6825a9 (diff)
downloadgit-587a9ee7da348f5e6696720d770d0e0da597827c.tar.gz
Show interpreted branch name in error messages
Change the error message when doing: "git branch @{-1}", "git checkout -b @{-1}", or "git branch -m foo @{-1}" * was: A branch named '@{-1}' already exists. * now: A branch named 'bar' already exists. Signed-off-by: Conrad Irwin <conrad.irwin@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 'branch.c')
-rw-r--r--branch.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/branch.c b/branch.c
index ff84b5b9b7..1fe3078a6c 100644
--- a/branch.c
+++ b/branch.c
@@ -146,7 +146,7 @@ int validate_new_branchname(const char *name, struct strbuf *ref, int force)
if (!ref_exists(ref->buf))
return 0;
else if (!force)
- die("A branch named '%s' already exists.", name);
+ die("A branch named '%s' already exists.", ref->buf + strlen("refs/heads/"));
head = resolve_ref("HEAD", sha1, 0, NULL);
if (!is_bare_repository() && head && !strcmp(head, ref->buf))