summaryrefslogtreecommitdiff
path: root/branch.c
diff options
context:
space:
mode:
authorJunio C Hamano <gitster@pobox.com>2008-10-21 17:58:11 -0700
committerJunio C Hamano <gitster@pobox.com>2008-10-21 17:58:11 -0700
commita157400c972bbdeab2b5629658c99839c855f5ab (patch)
tree95c9ae9bf86dcc6e2bd4a3b0b217f5bef8622b59 /branch.c
parent6af50f7536d559f891d08597203ba605726511d6 (diff)
parentacd3b9eca82e38950f94e4708b528b7dae09a7c8 (diff)
downloadgit-a157400c972bbdeab2b5629658c99839c855f5ab.tar.gz
Merge branch 'jc/maint-co-track'
* jc/maint-co-track: Enhance hold_lock_file_for_{update,append}() API demonstrate breakage of detached checkout with symbolic link HEAD Fix "checkout --track -b newbranch" on detached HEAD Conflicts: builtin-commit.c
Diffstat (limited to 'branch.c')
-rw-r--r--branch.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/branch.c b/branch.c
index 205b89dc69..b1ac837f3d 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);