git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 3/6] Improve error message for branching an existing branch
@ 2009-02-19  7:36 John Tapsell
  0 siblings, 0 replies; only message in thread
From: John Tapsell @ 2009-02-19  7:36 UTC (permalink / raw)
  To: Git Mailing List

Signed-off-by: John Tapsell <johnflux@gmail.com>
---
 branch.c |    3 ++-
 1 files changed, 2 insertions(+), 1 deletions(-)

diff --git a/branch.c b/branch.c
index 1f00e44..86ac293 100644
--- a/branch.c
+++ b/branch.c
@@ -120,7 +120,8 @@ void create_branch(const char *head,
 
 	if (resolve_ref(ref.buf, sha1, 1, NULL)) {
 		if (!force)
-			die("A branch named '%s' already exists.", name);
+			die("A branch named '%s' already exists.\n"
+			    "Maybe you wanted to change to this branch with: git checkout '%s'", name, name);
 		else if (!is_bare_repository() && !strcmp(head, name))
 			die("Cannot force update the current branch.");
 		forcing = 1;
-- 
1.6.2.rc1.3.g7d31b.dirty

^ permalink raw reply related	[flat|nested] only message in thread

only message in thread, other threads:[~2009-02-19  7:37 UTC | newest]

Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2009-02-19  7:36 [PATCH 3/6] Improve error message for branching an existing branch John Tapsell

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).