X-Git-Url: https://git.tokkee.org/?a=blobdiff_plain;f=branch.c;h=6a750574fd376e4d54e4ef2576674d42521f1529;hb=65117abc040d95ef9877c3b14a24f4bc6aeaf4cb;hp=b1e59f2196b933ab7169a30efc5d1d340f8f9c5c;hpb=10d9d887ecdc81197162d7bbe5dfc0d028498fd6;p=git.git diff --git a/branch.c b/branch.c index b1e59f219..6a750574f 100644 --- a/branch.c +++ b/branch.c @@ -129,7 +129,9 @@ void create_branch(const char *head, die("Cannot setup tracking information; starting point is not a branch."); break; case 1: - /* Unique completion -- good */ + /* Unique completion -- good, only if it is a real ref */ + if (track == BRANCH_TRACK_EXPLICIT && !strcmp(real_ref, "HEAD")) + die("Cannot setup tracking information; starting point is not a branch."); break; default: die("Ambiguous object name: '%s'.", start_name);