git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* bug report? fatal: Ambiguous object name: 'xxx' during branch operation
       [not found] <CAB1hNr8itJV1-pzWxUo1KPsZNivg+KuRq_5jUwLUyCUpk7k=4w@mail.gmail.com>
@ 2012-03-06 23:18 ` Arya Irani
  2012-03-06 23:44   ` Junio C Hamano
  0 siblings, 1 reply; 2+ messages in thread
From: Arya Irani @ 2012-03-06 23:18 UTC (permalink / raw)
  To: git

If the default start-point for a branch is HEAD, then how can it fail
due to ambiguity?  Or what the heck is going on here? :-)

$ git branch -a
* 1.1-SNAPSHOT
  master
  remotes/1.1-SNAPSHOT
  remotes/trunk
$

$ git branch getProviders
warning: refname '1.1-SNAPSHOT' is ambiguous.
fatal: Ambiguous object name: '1.1-SNAPSHOT'.
$

$ cat .git/HEAD
ref: refs/heads/1.1-SNAPSHOT
$

$ git branch getProviders refs/heads/1.1-SNAPSHOT
$
success!


[svn-remote "svn"]
url = https://host/svn/all
fetch = GHIE/maven-projects/hie-util/trunk:refs/remotes/trunk
branches = GHIE/maven-projects/hie-util/branches/*:refs/remotes/*
tags = GHIE/maven-projects/hie-util/tags/*:refs/remotes/tags/*

Thanks,
Arya

P.S.  I'll use --prefix for svn to avoid this in the future!

^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: bug report? fatal: Ambiguous object name: 'xxx' during branch operation
  2012-03-06 23:18 ` bug report? fatal: Ambiguous object name: 'xxx' during branch operation Arya Irani
@ 2012-03-06 23:44   ` Junio C Hamano
  0 siblings, 0 replies; 2+ messages in thread
From: Junio C Hamano @ 2012-03-06 23:44 UTC (permalink / raw)
  To: Arya Irani; +Cc: git

Arya Irani <arya.irani@gmail.com> writes:

> If the default start-point for a branch is HEAD, then how can it fail
> due to ambiguity?

The whole create_branch() codepath is a mess and needs to be cleaned
up, but in the shorter term, something like this, perhaps?

 builtin/branch.c |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/builtin/branch.c b/builtin/branch.c
index d8cccf7..02d0653 100644
--- a/builtin/branch.c
+++ b/builtin/branch.c
@@ -807,7 +807,7 @@ int cmd_branch(int argc, const char **argv, const char *prefix)
 	} else if (argc > 0 && argc <= 2) {
 		if (kinds != REF_LOCAL_BRANCH)
 			die(_("-a and -r options to 'git branch' do not make sense with a branch name"));
-		create_branch(head, argv[0], (argc == 2) ? argv[1] : head,
+		create_branch(head, argv[0], (argc == 2) ? argv[1] : "HEAD",
 			      force_create, reflog, 0, track);
 	} else
 		usage_with_options(builtin_branch_usage, options);

^ permalink raw reply related	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2012-03-06 23:44 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
     [not found] <CAB1hNr8itJV1-pzWxUo1KPsZNivg+KuRq_5jUwLUyCUpk7k=4w@mail.gmail.com>
2012-03-06 23:18 ` bug report? fatal: Ambiguous object name: 'xxx' during branch operation Arya Irani
2012-03-06 23:44   ` Junio C Hamano

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).