aboutsummaryrefslogtreecommitdiff
path: root/t
diff options
context:
space:
mode:
authorJunio C Hamano <gitster@pobox.com>2009-01-11 23:24:42 -0800
committerJunio C Hamano <gitster@pobox.com>2009-01-11 23:24:42 -0800
commit687004b512d30daeff0e64dc718f803433d73329 (patch)
tree3f3aaaa2de75ecf63178c9b82029df598a803c9b /t
parent4fc988efe66ea079c926b1f01bf563a946b7797f (diff)
parent3442ea4a75a3c76f65efac71b414584f765e5a99 (diff)
downloadgit-687004b512d30daeff0e64dc718f803433d73329.tar.gz
git-687004b512d30daeff0e64dc718f803433d73329.tar.xz
Merge branch 'jc/maint-do-not-switch-to-non-commit' into maint
* jc/maint-do-not-switch-to-non-commit: git checkout: do not allow switching to a tree-ish that is not a commit
Diffstat (limited to 't')
-rwxr-xr-xt/t2011-checkout-invalid-head.sh4
1 files changed, 4 insertions, 0 deletions
diff --git a/t/t2011-checkout-invalid-head.sh b/t/t2011-checkout-invalid-head.sh
index 764bb0a6b..15ebdc26e 100755
--- a/t/t2011-checkout-invalid-head.sh
+++ b/t/t2011-checkout-invalid-head.sh
@@ -10,6 +10,10 @@ test_expect_success 'setup' '
git commit -m initial
'
+test_expect_success 'checkout should not start branch from a tree' '
+ test_must_fail git checkout -b newbranch master^{tree}
+'
+
test_expect_success 'checkout master from invalid HEAD' '
echo 0000000000000000000000000000000000000000 >.git/HEAD &&
git checkout master --