Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.kernel.org/pub/scm/git/git.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJunio C Hamano <gitster@pobox.com>2008-09-08 09:44:45 +0400
committerJunio C Hamano <gitster@pobox.com>2008-09-08 09:44:45 +0400
commit11bd3ddb913afd9665e7e822ea54be4fc8d2d5ea (patch)
tree1b15bd04ca47863855c045b34dd69728be98a84b /t/t7201-co.sh
parentaf9ce1ffc6de9774e90a91f27fb1febd027f74f1 (diff)
parent8fdcf3125465f70c0cad5be5ab192d46e46307c7 (diff)
Merge branch 'jc/maint-checkout-fix'
* jc/maint-checkout-fix: checkout: do not check out unmerged higher stages randomly Conflicts: t/t7201-co.sh
Diffstat (limited to 't/t7201-co.sh')
-rwxr-xr-xt/t7201-co.sh22
1 files changed, 22 insertions, 0 deletions
diff --git a/t/t7201-co.sh b/t/t7201-co.sh
index 543b1c2898..25181388f8 100755
--- a/t/t7201-co.sh
+++ b/t/t7201-co.sh
@@ -369,4 +369,26 @@ test_expect_success \
'checkout with --track, but without -b, fails with too short tracked name' '
test_must_fail git checkout --track renamer'
+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