3
3
mkdir Z
4
4
for a in N D M
5
5
do
6
- for b in N D M
7
- do
8
- p=$a$b
6
+ for b in N D M
7
+ do
8
+ p=$a$b
9
9
echo This is $p from the original tree. > $p
10
10
echo This is Z/$p from the original tree. > Z/$p
11
11
test_expect_success " adding test file $p and Z/$p " '
16
16
done
17
17
echo This is SS from the original tree. > SS
18
18
test_expect_success ' adding test file SS' '
19
- git update-index --add SS
19
+ git update-index --add SS
20
20
'
21
21
cat > TT << \EOF
22
22
This is a trivial merge sample text.
@@ -31,10 +31,10 @@ the word, expected to be upcased by Branch B.
31
31
This concludes the trivial merge sample file.
32
32
EOF
33
33
test_expect_success ' adding test file TT' '
34
- git update-index --add TT
34
+ git update-index --add TT
35
35
'
36
36
test_expect_success ' prepare initial tree' '
37
- tree_O=$(git write-tree)
37
+ tree_O=$(git write-tree)
38
38
'
39
39
40
40
# ###############################################################
@@ -46,46 +46,46 @@ test_expect_success 'prepare initial tree' '
46
46
to_remove=$( echo D? Z/D? )
47
47
rm -f $to_remove
48
48
test_expect_success ' change in branch A (removal)' '
49
- git update-index --remove $to_remove
49
+ git update-index --remove $to_remove
50
50
'
51
51
52
52
for p in M? Z/M?
53
53
do
54
- echo This is modified $p in the branch A. > $p
55
- test_expect_success ' change in branch A (modification)' '
56
- git update-index $p
57
- '
54
+ echo This is modified $p in the branch A. > $p
55
+ test_expect_success ' change in branch A (modification)' '
56
+ git update-index $p
57
+ '
58
58
done
59
59
60
60
for p in AN AA Z/AN Z/AA
61
61
do
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
65
- '
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
65
+ '
66
66
done
67
67
68
68
echo This is SS from the modified tree. > SS
69
69
echo This is LL from the modified tree. > LL
70
70
test_expect_success ' change in branch A (addition)' '
71
- git update-index --add LL &&
72
- git update-index SS
71
+ git update-index --add LL &&
72
+ git update-index SS
73
73
'
74
74
mv TT TT-
75
75
sed -e ' /Branch A/s/word/WORD/g' < TT- > TT
76
76
rm -f TT-
77
77
test_expect_success ' change in branch A (edit)' '
78
- git update-index TT
78
+ git update-index TT
79
79
'
80
80
81
81
mkdir DF
82
82
echo Branch A makes a file at DF/DF, creating a directory DF. > DF/DF
83
83
test_expect_success ' change in branch A (change file to directory)' '
84
- git update-index --add DF/DF
84
+ git update-index --add DF/DF
85
85
'
86
86
87
87
test_expect_success ' recording branch A tree' '
88
- tree_A=$(git write-tree)
88
+ tree_A=$(git write-tree)
89
89
'
90
90
91
91
# ###############################################################
@@ -95,64 +95,64 @@ test_expect_success 'recording branch A tree' '
95
95
rm -rf [NDMASLT][NDMASLT] Z DF
96
96
mkdir Z
97
97
test_expect_success ' reading original tree and checking out' '
98
- git read-tree $tree_O &&
99
- git checkout-index -a
98
+ git read-tree $tree_O &&
99
+ git checkout-index -a
100
100
'
101
101
102
102
to_remove=$( echo ? D Z/? D)
103
103
rm -f $to_remove
104
104
test_expect_success ' change in branch B (removal)' '
105
- git update-index --remove $to_remove
105
+ git update-index --remove $to_remove
106
106
'
107
107
108
108
for p in ? M Z/? M
109
109
do
110
- echo This is modified $p in the branch B. > $p
111
- test_expect_success ' change in branch B (modification)' '
112
- git update-index $p
113
- '
110
+ echo This is modified $p in the branch B. > $p
111
+ test_expect_success ' change in branch B (modification)' '
112
+ git update-index $p
113
+ '
114
114
done
115
115
116
116
for p in NA AA Z/NA Z/AA
117
117
do
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
121
- '
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
121
+ '
122
122
done
123
123
echo This is SS from the modified tree. > SS
124
124
echo This is LL from the modified tree. > LL
125
125
test_expect_success ' change in branch B (addition and modification)' '
126
- git update-index --add LL &&
127
- git update-index SS
126
+ git update-index --add LL &&
127
+ git update-index SS
128
128
'
129
129
mv TT TT-
130
130
sed -e ' /Branch B/s/word/WORD/g' < TT- > TT
131
131
rm -f TT-
132
132
test_expect_success ' change in branch B (modification)' '
133
- git update-index TT
133
+ git update-index TT
134
134
'
135
135
136
136
echo Branch B makes a file at DF. > DF
137
137
test_expect_success ' change in branch B (addition of a file to conflict with directory)' '
138
- git update-index --add DF
138
+ git update-index --add DF
139
139
'
140
140
141
141
test_expect_success ' recording branch B tree' '
142
- tree_B=$(git write-tree)
142
+ tree_B=$(git write-tree)
143
143
'
144
144
145
145
test_expect_success ' keep contents of 3 trees for easy access' '
146
- rm -f .git/index &&
147
- git read-tree $tree_O &&
148
- mkdir .orig-O &&
149
- git checkout-index --prefix=.orig-O/ -f -q -a &&
150
- rm -f .git/index &&
151
- git read-tree $tree_A &&
152
- mkdir .orig-A &&
153
- git checkout-index --prefix=.orig-A/ -f -q -a &&
154
- rm -f .git/index &&
155
- git read-tree $tree_B &&
156
- mkdir .orig-B &&
157
- git checkout-index --prefix=.orig-B/ -f -q -a
146
+ rm -f .git/index &&
147
+ git read-tree $tree_O &&
148
+ mkdir .orig-O &&
149
+ git checkout-index --prefix=.orig-O/ -f -q -a &&
150
+ rm -f .git/index &&
151
+ git read-tree $tree_A &&
152
+ mkdir .orig-A &&
153
+ git checkout-index --prefix=.orig-A/ -f -q -a &&
154
+ rm -f .git/index &&
155
+ git read-tree $tree_B &&
156
+ mkdir .orig-B &&
157
+ git checkout-index --prefix=.orig-B/ -f -q -a
158
158
'
0 commit comments