summaryrefslogtreecommitdiff
path: root/t/t1000-read-tree-m-3way.sh
diff options
context:
space:
mode:
authorJunio C Hamano <junkio@cox.net>2005-06-11 09:50:51 (GMT)
committerLinus Torvalds <torvalds@ppc970.osdl.org>2005-06-13 03:40:20 (GMT)
commit32192e6622d78347448cfc0572827d6e64e0de28 (patch)
tree460a1aa7e3734888a6e25721c11e39deede40084 /t/t1000-read-tree-m-3way.sh
parente7f9bc411c8519468c33e1d882fb02cbe9c1ea55 (diff)
downloadgit-32192e6622d78347448cfc0572827d6e64e0de28.zip
git-32192e6622d78347448cfc0572827d6e64e0de28.tar.gz
git-32192e6622d78347448cfc0572827d6e64e0de28.tar.bz2
[PATCH] Finish making --emu23 equivalent to pure 2-way merge.
This adds #3ALT rule (and #2ALT rule for symmetry) to the read-tree 3-way merge logic that collapses paths that are added only in one branch and not in the other internally. This makes --emu23 to succeed in the last remaining case where the pure 2-way merge succeeded and earlier one failed. Running diff between t1001 and t1005 test scripts shows that the only difference between the two is that --emu23 can leave the states into separate stages so that the user can use usual 3-way merge resolution techniques to carry forward the local changes when pure 2-way merge would have refused to run. Signed-off-by: Junio C Hamano <junkio@cox.net> Signed-off-by: Linus Torvalds <torvalds@osdl.org>
Diffstat (limited to 't/t1000-read-tree-m-3way.sh')
-rwxr-xr-xt/t1000-read-tree-m-3way.sh32
1 files changed, 20 insertions, 12 deletions
diff --git a/t/t1000-read-tree-m-3way.sh b/t/t1000-read-tree-m-3way.sh
index 92833fe..3d9b3ac 100755
--- a/t/t1000-read-tree-m-3way.sh
+++ b/t/t1000-read-tree-m-3way.sh
@@ -75,13 +75,13 @@ In addition:
. ../lib-read-tree-m-3way.sh
################################################################
-# Trivial "majority when 3 stages exist" merge plus #5ALT trivial
-# merge.
+# 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
@@ -96,7 +96,7 @@ cat >expected <<\EOF
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 \
+ '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 and be up-to-date in !O && A && !B case.' \
+ '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 &&