summaryrefslogtreecommitdiff
path: root/t/t5706-clone-branch.sh
diff options
context:
space:
mode:
authorNguyễn Thái Ngọc Duy <pclouds@gmail.com>2012-01-16 16:46:14 +0700
committerJunio C Hamano <gitster@pobox.com>2012-01-16 16:26:26 -0800
commit920b691fe4da8115f9b79901411c0cc5fff17efe (patch)
treeef81f364cbcac0365fd7bf0cd6e3247dc0d515c8 /t/t5706-clone-branch.sh
parent9e5850460164f49dc9ae47569838084f5572846d (diff)
downloadgit-920b691fe4da8115f9b79901411c0cc5fff17efe.tar.gz
clone: refuse to clone if --branch points to bogus ref
It's possible that users make a typo in the branch name. Stop and let users recheck. Falling back to remote's HEAD is not documented any way. Except when using remote helper, the pack has not been transferred at this stage yet so we don't waste much bandwidth. Signed-off-by: Nguyễn Thái Ngọc Duy <pclouds@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 't/t5706-clone-branch.sh')
-rwxr-xr-xt/t5706-clone-branch.sh8
1 files changed, 2 insertions, 6 deletions
diff --git a/t/t5706-clone-branch.sh b/t/t5706-clone-branch.sh
index f3f9a76056..56be67e07e 100755
--- a/t/t5706-clone-branch.sh
+++ b/t/t5706-clone-branch.sh
@@ -57,12 +57,8 @@ test_expect_success 'clone -b does not munge remotes/origin/HEAD' '
)
'
-test_expect_success 'clone -b with bogus branch chooses HEAD' '
- git clone -b bogus parent clone-bogus &&
- (cd clone-bogus &&
- check_HEAD master &&
- check_file one
- )
+test_expect_success 'clone -b with bogus branch' '
+ test_must_fail git clone -b bogus parent clone-bogus
'
test_done