diff options
author | Junio C Hamano <gitster@pobox.com> | 2008-09-10 02:13:41 -0700 |
---|---|---|
committer | Junio C Hamano <gitster@pobox.com> | 2008-09-10 02:13:41 -0700 |
commit | 94c27881bd98d5bb70e3d4f8a18e384095c876b9 (patch) | |
tree | afb52cefd82080596aa910bb3e84b75e1d10ee9a /t | |
parent | 9f35e5fd544ab87488b12d9b97be983303e58bd2 (diff) | |
parent | 8fdcf3125465f70c0cad5be5ab192d46e46307c7 (diff) | |
download | git-94c27881bd98d5bb70e3d4f8a18e384095c876b9.tar.gz git-94c27881bd98d5bb70e3d4f8a18e384095c876b9.tar.xz |
Merge branch 'jc/maint-checkout-fix' into maint
* jc/maint-checkout-fix:
checkout: do not check out unmerged higher stages randomly
Diffstat (limited to 't')
-rwxr-xr-x | t/t7201-co.sh | 22 |
1 files changed, 22 insertions, 0 deletions
diff --git a/t/t7201-co.sh b/t/t7201-co.sh index 2e2b3bf53..fbec70d3c 100755 --- a/t/t7201-co.sh +++ b/t/t7201-co.sh @@ -337,4 +337,26 @@ test_expect_success \ test refs/heads/delete-me = "$(git symbolic-ref HEAD)" && test_must_fail git checkout --track -b track' +test_expect_success 'checkout an unmerged path should fail' ' + rm -f .git/index && + O=$(echo original | git hash-object -w --stdin) && + A=$(echo ourside | git hash-object -w --stdin) && + B=$(echo theirside | git hash-object -w --stdin) && + ( + echo "100644 $A 0 fild" && + echo "100644 $O 1 file" && + echo "100644 $A 2 file" && + echo "100644 $B 3 file" && + echo "100644 $A 0 filf" + ) | git update-index --index-info && + echo "none of the above" >sample && + cat sample >fild && + cat sample >file && + cat sample >filf && + test_must_fail git checkout fild file filf && + test_cmp sample fild && + test_cmp sample filf && + test_cmp sample file +' + test_done |