aboutsummaryrefslogtreecommitdiff
path: root/t/t7201-co.sh
diff options
context:
space:
mode:
authorJunio C Hamano <gitster@pobox.com>2008-10-16 23:37:44 -0700
committerJunio C Hamano <gitster@pobox.com>2008-10-17 14:35:06 -0700
commit51a94af845cb3f797abd638478834721d7295af7 (patch)
tree3572e5e0f3b87faabfe998a5c953858757a1328e /t/t7201-co.sh
parent8ed0a740dd42bd0724aebed6e3b07c4ea2a2d5e8 (diff)
downloadgit-51a94af845cb3f797abd638478834721d7295af7.tar.gz
git-51a94af845cb3f797abd638478834721d7295af7.tar.xz
Fix "checkout --track -b newbranch" on detached HEAD
The test to make sure that checkout fails when --track was asked for and we cannot set up tracking information in t7201 was wrong, and it turns out that the implementation for that feature itself was buggy. This fixes it. Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 't/t7201-co.sh')
-rwxr-xr-xt/t7201-co.sh14
1 files changed, 8 insertions, 6 deletions
diff --git a/t/t7201-co.sh b/t/t7201-co.sh
index fbec70d3c..ee2cab6bb 100755
--- a/t/t7201-co.sh
+++ b/t/t7201-co.sh
@@ -330,12 +330,14 @@ test_expect_success \
test "$(git config branch.track2.merge)"
git config branch.autosetupmerge false'
-test_expect_success \
- 'checkout w/--track from non-branch HEAD fails' '
- git checkout -b delete-me master &&
- rm .git/refs/heads/delete-me &&
- test refs/heads/delete-me = "$(git symbolic-ref HEAD)" &&
- test_must_fail git checkout --track -b track'
+test_expect_success 'checkout w/--track from non-branch HEAD fails' '
+ git checkout master^0 &&
+ test_must_fail git symbolic-ref HEAD &&
+ test_must_fail git checkout --track -b track &&
+ test_must_fail git rev-parse --verify track &&
+ test_must_fail git symbolic-ref HEAD &&
+ test "z$(git rev-parse master^0)" = "z$(git rev-parse HEAD)"
+'
test_expect_success 'checkout an unmerged path should fail' '
rm -f .git/index &&