X-Git-Url: https://git.verplant.org/?a=blobdiff_plain;f=t%2Ft1000-read-tree-m-3way.sh;h=89f0e81f2335e4ade732a22789d8bb1b1a13e908;hb=35cc4bcd10862db190df9685b7ad221f2a25404f;hp=c43588727b27f600b6a8ad1443981aaadea72590;hpb=f225b21807a5f6ac589132e4d004e78038d23375;p=git.git diff --git a/t/t1000-read-tree-m-3way.sh b/t/t1000-read-tree-m-3way.sh index c4358872..89f0e81f 100755 --- a/t/t1000-read-tree-m-3way.sh +++ b/t/t1000-read-tree-m-3way.sh @@ -75,12 +75,13 @@ In addition: . ../lib-read-tree-m-3way.sh ################################################################ -# This is the "no trivial merge unless all three exists" table. +# Trivial "majority when 3 stages exist" merge plus #2ALT, #3ALT +# and #5ALT trivial merges. cat >expected <<\EOF 100644 X 2 AA 100644 X 3 AA -100644 X 2 AN +100644 X 0 AN 100644 X 1 DD 100644 X 3 DF 100644 X 2 DF/DF @@ -88,15 +89,14 @@ cat >expected <<\EOF 100644 X 3 DM 100644 X 1 DN 100644 X 3 DN -100644 X 2 LL -100644 X 3 LL +100644 X 0 LL 100644 X 1 MD 100644 X 2 MD 100644 X 1 MM 100644 X 2 MM 100644 X 3 MM 100644 X 0 MN -100644 X 3 NA +100644 X 0 NA 100644 X 1 ND 100644 X 2 ND 100644 X 0 NM @@ -107,7 +107,7 @@ cat >expected <<\EOF 100644 X 3 TT 100644 X 2 Z/AA 100644 X 3 Z/AA -100644 X 2 Z/AN +100644 X 0 Z/AN 100644 X 1 Z/DD 100644 X 1 Z/DM 100644 X 3 Z/DM @@ -119,7 +119,7 @@ cat >expected <<\EOF 100644 X 2 Z/MM 100644 X 3 Z/MM 100644 X 0 Z/MN -100644 X 3 Z/NA +100644 X 0 Z/NA 100644 X 1 Z/ND 100644 X 2 Z/ND 100644 X 0 Z/NM @@ -233,23 +233,31 @@ test_expect_failure \ git-update-cache --add XX && git-read-tree -m $tree_O $tree_A $tree_B" -test_expect_failure \ - '2 - must not have an entry not in A.' \ +test_expect_success \ + '2 - must match B in !O && !A && B case.' \ "rm -f .git/index NA && cp .orig-B/NA NA && git-update-cache --add NA && git-read-tree -m $tree_O $tree_A $tree_B" test_expect_success \ - '3 - must match and be up-to-date in !O && A && !B case.' \ + '2 - matching B alone is OK in !O && !A && B case.' \ + "rm -f .git/index NA && + cp .orig-B/NA NA && + git-update-cache --add NA && + echo extra >>NA && + git-read-tree -m $tree_O $tree_A $tree_B" + +test_expect_success \ + '3 - must match A in !O && A && !B case.' \ "rm -f .git/index AN && cp .orig-A/AN AN && git-update-cache --add AN && git-read-tree -m $tree_O $tree_A $tree_B && check_result" -test_expect_failure \ - '3 (fail) - must match and be up-to-date in !O && A && !B case.' \ +test_expect_success \ + '3 - matching A alone is OK in !O && A && !B case.' \ "rm -f .git/index AN && cp .orig-A/AN AN && git-update-cache --add AN && @@ -257,7 +265,7 @@ test_expect_failure \ git-read-tree -m $tree_O $tree_A $tree_B" test_expect_failure \ - '3 (fail) - must match and be up-to-date in !O && A && !B case.' \ + '3 (fail) - must match A in !O && A && !B case.' \ "rm -f .git/index AN && cp .orig-A/AN AN && echo extra >>AN && @@ -289,23 +297,24 @@ test_expect_failure \ git-read-tree -m $tree_O $tree_A $tree_B" test_expect_success \ - '5 - must match and be up-to-date in !O && A && B && A==B case.' \ + '5 - must match in !O && A && B && A==B case.' \ "rm -f .git/index LL && cp .orig-A/LL LL && git-update-cache --add LL && git-read-tree -m $tree_O $tree_A $tree_B && check_result" -test_expect_failure \ - '5 (fail) - must match and be up-to-date in !O && A && B && A==B case.' \ +test_expect_success \ + '5 - must match in !O && A && B && A==B case.' \ "rm -f .git/index LL && cp .orig-A/LL LL && git-update-cache --add LL && echo extra >>LL && - git-read-tree -m $tree_O $tree_A $tree_B" + git-read-tree -m $tree_O $tree_A $tree_B && + check_result" test_expect_failure \ - '5 (fail) - must match and be up-to-date in !O && A && B && A==B case.' \ + '5 (fail) - must match A in !O && A && B && A==B case.' \ "rm -f .git/index LL && cp .orig-A/LL LL && echo extra >>LL && @@ -455,6 +464,15 @@ test_expect_success \ git-read-tree -m $tree_O $tree_A $tree_B && check_result" +test_expect_success \ + '14 - may match B in O && A && B && O==A && O!=B case' \ + "rm -f .git/index NM && + cp .orig-B/NM NM && + git-update-cache --add NM && + echo extra >>NM && + git-read-tree -m $tree_O $tree_A $tree_B && + check_result" + test_expect_failure \ '14 (fail) - must match and be up-to-date in O && A && B && O==A && O!=B case' \ "rm -f .git/index NM &&