{"thread":{"id":"29865","subject":"bug report? fatal: Ambiguous object name: 'xxx' during branch operation","startedAt":"2012-03-06T23:18:40Z","lastAt":"2012-03-06T23:44:01Z","messageCount":2,"participants":["Arya Irani","Junio C Hamano"],"isPatch":false,"patchVersion":null,"patchTotal":null},"messages":[{"id":"186277","messageId":"CAB1hNr8-iPbXD-7eEOxZtrJWO78V8sDmwWWQRMMExvtGtpPrhw@mail.gmail.com","threadId":"29865","inReplyTo":"CAB1hNr8itJV1-pzWxUo1KPsZNivg+KuRq_5jUwLUyCUpk7k=4w@mail.gmail.com","subject":"bug report? fatal: Ambiguous object name: 'xxx' during branch operation","fromName":"Arya Irani","fromEmail":"arya.irani@gmail.com","sentAt":"2012-03-06T23:18:40Z","receivedAt":"2012-03-06T23:18:40Z","isPatch":false,"sender":{"key":"arya.irani@gmail.com","avatar":null},"body":"If the default start-point for a branch is HEAD, then how can it fail\ndue to ambiguity?  Or what the heck is going on here? :-)\n\n$ git branch -a\n* 1.1-SNAPSHOT\n  master\n  remotes/1.1-SNAPSHOT\n  remotes/trunk\n$\n\n$ git branch getProviders\nwarning: refname '1.1-SNAPSHOT' is ambiguous.\nfatal: Ambiguous object name: '1.1-SNAPSHOT'.\n$\n\n$ cat .git/HEAD\nref: refs/heads/1.1-SNAPSHOT\n$\n\n$ git branch getProviders refs/heads/1.1-SNAPSHOT\n$\nsuccess!\n\n\n[svn-remote \"svn\"]\nurl = https://host/svn/all\nfetch = GHIE/maven-projects/hie-util/trunk:refs/remotes/trunk\nbranches = GHIE/maven-projects/hie-util/branches/*:refs/remotes/*\ntags = GHIE/maven-projects/hie-util/tags/*:refs/remotes/tags/*\n\nThanks,\nArya\n\nP.S.  I'll use --prefix for svn to avoid this in the future!\n"},{"id":"186279","messageId":"7vvcmhpa66.fsf@alter.siamese.dyndns.org","threadId":"29865","inReplyTo":"CAB1hNr8-iPbXD-7eEOxZtrJWO78V8sDmwWWQRMMExvtGtpPrhw@mail.gmail.com","subject":"Re: bug report? fatal: Ambiguous object name: 'xxx' during branch operation","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2012-03-06T23:44:01Z","receivedAt":"2012-03-06T23:44:01Z","isPatch":false,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"Arya Irani <arya.irani@gmail.com> writes:\n\n> If the default start-point for a branch is HEAD, then how can it fail\n> due to ambiguity?\n\nThe whole create_branch() codepath is a mess and needs to be cleaned\nup, but in the shorter term, something like this, perhaps?\n\n builtin/branch.c |    2 +-\n 1 file changed, 1 insertion(+), 1 deletion(-)\n\ndiff --git a/builtin/branch.c b/builtin/branch.c\nindex d8cccf7..02d0653 100644\n--- a/builtin/branch.c\n+++ b/builtin/branch.c\n@@ -807,7 +807,7 @@ int cmd_branch(int argc, const char **argv, const char *prefix)\n \t} else if (argc > 0 && argc <= 2) {\n \t\tif (kinds != REF_LOCAL_BRANCH)\n \t\t\tdie(_(\"-a and -r options to 'git branch' do not make sense with a branch name\"));\n-\t\tcreate_branch(head, argv[0], (argc == 2) ? argv[1] : head,\n+\t\tcreate_branch(head, argv[0], (argc == 2) ? argv[1] : \"HEAD\",\n \t\t\t      force_create, reflog, 0, track);\n \t} else\n \t\tusage_with_options(builtin_branch_usage, options);\n"}]}