X-Git-Url: https://git.tokkee.org/?a=blobdiff_plain;f=t%2Ft7201-co.sh;fp=t%2Ft7201-co.sh;h=c7ae14118a538414c71170516d683a888878a656;hb=38901a48375952ab6c02f22bddfa19ac2bec2c36;hp=88692f98774bb22f0fb2850b6331e63e8bb65966;hpb=db9410990ee41f2b253763621c0023c782ec86e2;p=git.git 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