aboutsummaryrefslogtreecommitdiff
path: root/t/t7201-co.sh
diff options
context:
space:
mode:
Diffstat (limited to 't/t7201-co.sh')
-rwxr-xr-xt/t7201-co.sh25
1 files changed, 25 insertions, 0 deletions
diff --git a/t/t7201-co.sh b/t/t7201-co.sh
index 88692f987..c7ae14118 100755
--- a/t/t7201-co.sh
+++ b/t/t7201-co.sh
@@ -382,4 +382,29 @@ test_expect_success 'checkout with an unmerged path can be ignored' '
test_cmp sample file
'
+test_expect_success 'checkout unmerged stage' '
+ 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 &&
+ echo ourside >expect &&
+ cat sample >fild &&
+ cat sample >file &&
+ cat sample >filf &&
+ git checkout --ours . &&
+ test_cmp expect fild &&
+ test_cmp expect filf &&
+ test_cmp expect file &&
+ git checkout --theirs file &&
+ test ztheirside = "z$(cat file)"
+'
+
test_done