diff options
author | Junio C Hamano <gitster@pobox.com> | 2009-01-03 13:57:30 -0800 |
---|---|---|
committer | Junio C Hamano <gitster@pobox.com> | 2009-01-03 13:57:30 -0800 |
commit | 8ea6ae99b2314ddb24dd9121335b7a5583047f05 (patch) | |
tree | 4041eec5fe9cfc6ba30192cee72a10f6125179c7 /t | |
parent | Merge branch 'ap/maint-apply-modefix' (diff) | |
parent | git checkout: do not allow switching to a tree-ish that is not a commit (diff) | |
download | tgif-8ea6ae99b2314ddb24dd9121335b7a5583047f05.tar.xz |
Merge branch 'jc/maint-do-not-switch-to-non-commit'
* 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-x | t/t2011-checkout-invalid-head.sh | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/t/t2011-checkout-invalid-head.sh b/t/t2011-checkout-invalid-head.sh index 764bb0a6bc..15ebdc26eb 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 -- |