1 : Included from t1000-read-tree-m-3way.sh and others
9 echo This is
$p from the original tree.
>$p
10 echo This is Z
/$p from the original tree.
>Z
/$p
11 test_expect_success
"adding test file $p and Z/$p" '
12 git update-index --add $p &&
13 git update-index --add Z/$p
17 echo This is SS from the original tree.
>SS
18 test_expect_success
'adding test file SS' '
19 git update-index --add SS
22 This is a trivial merge sample text.
23 Branch A is expected to upcase this word
, here.
24 There are some filler lines to avoid
diff context
28 and this one is yet another one of them.
29 At the very end
, here comes another line
, that is
30 the word
, expected to be upcased by Branch B.
31 This concludes the trivial merge sample
file.
33 test_expect_success
'adding test file TT' '
34 git update-index --add TT
36 test_expect_success
'prepare initial tree' '
37 tree_O=$(git write-tree)
40 ################################################################
41 # Branch A and B makes the changes according to the above matrix.
43 ################################################################
46 to_remove
=$
(echo D? Z
/D?
)
48 test_expect_success
'change in branch A (removal)' '
49 git update-index --remove $to_remove
54 echo This is modified
$p in the branch A.
>$p
55 test_expect_success
'change in branch A (modification)' '
60 for p
in AN AA Z
/AN Z
/AA
62 echo This is added
$p in the branch A.
>$p
63 test_expect_success
'change in branch A (addition)' '
64 git update-index --add $p
68 echo This is SS from the modified tree.
>SS
69 echo This is LL from the modified tree.
>LL
70 test_expect_success
'change in branch A (addition)' '
71 git update-index --add LL &&
75 sed -e '/Branch A/s/word/WORD/g' <TT-
>TT
77 test_expect_success
'change in branch A (edit)' '
82 echo Branch A makes a
file at DF
/DF
, creating a directory DF.
>DF
/DF
83 test_expect_success
'change in branch A (change file to directory)' '
84 git update-index --add DF/DF
87 test_expect_success
'recording branch A tree' '
88 tree_A=$(git write-tree)
91 ################################################################
95 rm -rf [NDMASLT
][NDMASLT
] Z DF
97 test_expect_success
'reading original tree and checking out' '
98 git read-tree $tree_O &&
102 to_remove
=$
(echo ?D Z
/?D
)
104 test_expect_success
'change in branch B (removal)' '
105 git update-index --remove $to_remove
110 echo This is modified
$p in the branch B.
>$p
111 test_expect_success
'change in branch B (modification)' '
116 for p
in NA AA Z
/NA Z
/AA
118 echo This is added
$p in the branch B.
>$p
119 test_expect_success
'change in branch B (addition)' '
120 git update-index --add $p
123 echo This is SS from the modified tree.
>SS
124 echo This is LL from the modified tree.
>LL
125 test_expect_success
'change in branch B (addition and modification)' '
126 git update-index --add LL &&
130 sed -e '/Branch B/s/word/WORD/g' <TT-
>TT
132 test_expect_success
'change in branch B (modification)' '
136 echo Branch B makes a
file at DF.
>DF
137 test_expect_success
'change in branch B (addition of a file to conflict with directory)' '
138 git update-index --add DF
141 test_expect_success
'recording branch B tree' '
142 tree_B=$(git write-tree)
145 test_expect_success
'keep contents of 3 trees for easy access' '
147 git read-tree $tree_O &&
149 git checkout-index --prefix=.orig-O/ -f -q -a &&
151 git read-tree $tree_A &&
153 git checkout-index --prefix=.orig-A/ -f -q -a &&
155 git read-tree $tree_B &&
157 git checkout-index --prefix=.orig-B/ -f -q -a