3 f259c4c1 2021-09-24 stsp # Copyright (c) 2021 Stefan Sperling <stsp@openbsd.org>
5 f259c4c1 2021-09-24 stsp # Permission to use, copy, modify, and distribute this software for any
6 f259c4c1 2021-09-24 stsp # purpose with or without fee is hereby granted, provided that the above
7 f259c4c1 2021-09-24 stsp # copyright notice and this permission notice appear in all copies.
9 f259c4c1 2021-09-24 stsp # THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
10 f259c4c1 2021-09-24 stsp # WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
11 f259c4c1 2021-09-24 stsp # MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
12 f259c4c1 2021-09-24 stsp # ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
13 f259c4c1 2021-09-24 stsp # WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
14 f259c4c1 2021-09-24 stsp # ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
15 f259c4c1 2021-09-24 stsp # OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
17 f259c4c1 2021-09-24 stsp . ./common.sh
19 f259c4c1 2021-09-24 stsp test_merge_basic() {
20 f259c4c1 2021-09-24 stsp local testroot=`test_init merge_basic`
21 f259c4c1 2021-09-24 stsp local commit0=`git_show_head $testroot/repo`
22 f259c4c1 2021-09-24 stsp local commit0_author_time=`git_show_author_time $testroot/repo`
24 f73bf5bd 2023-10-01 naddy git -C $testroot/repo checkout -q -b newbranch
25 f259c4c1 2021-09-24 stsp echo "modified delta on branch" > $testroot/repo/gamma/delta
26 f259c4c1 2021-09-24 stsp git_commit $testroot/repo -m "committing to delta on newbranch"
27 f259c4c1 2021-09-24 stsp local branch_commit0=`git_show_branch_head $testroot/repo newbranch`
29 f259c4c1 2021-09-24 stsp echo "modified alpha on branch" > $testroot/repo/alpha
30 f259c4c1 2021-09-24 stsp git_commit $testroot/repo -m "committing to alpha on newbranch"
31 f259c4c1 2021-09-24 stsp local branch_commit1=`git_show_branch_head $testroot/repo newbranch`
32 f73bf5bd 2023-10-01 naddy git -C $testroot/repo rm -q beta
33 f259c4c1 2021-09-24 stsp git_commit $testroot/repo -m "removing beta on newbranch"
34 f259c4c1 2021-09-24 stsp local branch_commit2=`git_show_branch_head $testroot/repo newbranch`
35 f259c4c1 2021-09-24 stsp echo "new file on branch" > $testroot/repo/epsilon/new
36 f73bf5bd 2023-10-01 naddy git -C $testroot/repo add epsilon/new
37 f259c4c1 2021-09-24 stsp git_commit $testroot/repo -m "adding new file on newbranch"
38 f259c4c1 2021-09-24 stsp local branch_commit3=`git_show_branch_head $testroot/repo newbranch`
39 f73bf5bd 2023-10-01 naddy (cd $testroot/repo && ln -s alpha symlink)
40 f73bf5bd 2023-10-01 naddy git -C $testroot/repo add symlink
41 f259c4c1 2021-09-24 stsp git_commit $testroot/repo -m "adding symlink on newbranch"
42 f259c4c1 2021-09-24 stsp local branch_commit4=`git_show_branch_head $testroot/repo newbranch`
43 5267b9e4 2021-09-26 stsp (cd $testroot/repo && ln -sf .got/bar dotgotbar.link)
44 f73bf5bd 2023-10-01 naddy git -C $testroot/repo add dotgotbar.link
45 5267b9e4 2021-09-26 stsp git_commit $testroot/repo -m "adding a bad symlink on newbranch"
46 5267b9e4 2021-09-26 stsp local branch_commit5=`git_show_branch_head $testroot/repo newbranch`
48 f259c4c1 2021-09-24 stsp got checkout -b master $testroot/repo $testroot/wt > /dev/null
50 49c543a6 2022-03-31 naddy if [ $ret -ne 0 ]; then
51 f259c4c1 2021-09-24 stsp echo "got checkout failed unexpectedly" >&2
52 f259c4c1 2021-09-24 stsp test_done "$testroot" "$ret"
56 179f9db0 2023-06-20 falsifian # create a divergent commit
57 f73bf5bd 2023-10-01 naddy git -C $testroot/repo checkout -q master
58 f259c4c1 2021-09-24 stsp echo "modified zeta on master" > $testroot/repo/epsilon/zeta
59 f259c4c1 2021-09-24 stsp git_commit $testroot/repo -m "committing to zeta on master"
60 f259c4c1 2021-09-24 stsp local master_commit=`git_show_head $testroot/repo`
62 5e91dae4 2022-08-30 stsp # need an up-to-date work tree for 'got merge'
63 f259c4c1 2021-09-24 stsp (cd $testroot/wt && got merge newbranch \
64 f259c4c1 2021-09-24 stsp > $testroot/stdout 2> $testroot/stderr)
66 49c543a6 2022-03-31 naddy if [ $ret -eq 0 ]; then
67 f259c4c1 2021-09-24 stsp echo "got merge succeeded unexpectedly" >&2
68 ea4ee74a 2023-06-17 op test_done "$testroot" "1"
71 f259c4c1 2021-09-24 stsp echo -n "got: work tree must be updated before it can be used " \
72 f259c4c1 2021-09-24 stsp > $testroot/stderr.expected
73 f259c4c1 2021-09-24 stsp echo "to merge a branch" >> $testroot/stderr.expected
74 f259c4c1 2021-09-24 stsp cmp -s $testroot/stderr.expected $testroot/stderr
76 49c543a6 2022-03-31 naddy if [ $ret -ne 0 ]; then
77 f259c4c1 2021-09-24 stsp diff -u $testroot/stderr.expected $testroot/stderr
78 f259c4c1 2021-09-24 stsp test_done "$testroot" "$ret"
82 f259c4c1 2021-09-24 stsp (cd $testroot/wt && got update > /dev/null)
84 49c543a6 2022-03-31 naddy if [ $ret -ne 0 ]; then
85 f259c4c1 2021-09-24 stsp echo "got update failed unexpectedly" >&2
86 f259c4c1 2021-09-24 stsp test_done "$testroot" "$ret"
90 5e91dae4 2022-08-30 stsp # must not use a mixed-commit work tree with 'got merge'
91 f259c4c1 2021-09-24 stsp (cd $testroot/wt && got update -c $commit0 alpha > /dev/null)
93 49c543a6 2022-03-31 naddy if [ $ret -ne 0 ]; then
94 f259c4c1 2021-09-24 stsp echo "got update failed unexpectedly" >&2
95 f259c4c1 2021-09-24 stsp test_done "$testroot" "$ret"
98 f259c4c1 2021-09-24 stsp (cd $testroot/wt && got merge newbranch \
99 f259c4c1 2021-09-24 stsp > $testroot/stdout 2> $testroot/stderr)
101 49c543a6 2022-03-31 naddy if [ $ret -eq 0 ]; then
102 f259c4c1 2021-09-24 stsp echo "got merge succeeded unexpectedly" >&2
103 ea4ee74a 2023-06-17 op test_done "$testroot" "1"
106 f259c4c1 2021-09-24 stsp echo -n "got: work tree contains files from multiple base commits; " \
107 f259c4c1 2021-09-24 stsp > $testroot/stderr.expected
108 f259c4c1 2021-09-24 stsp echo "the entire work tree must be updated first" \
109 f259c4c1 2021-09-24 stsp >> $testroot/stderr.expected
110 f259c4c1 2021-09-24 stsp cmp -s $testroot/stderr.expected $testroot/stderr
112 49c543a6 2022-03-31 naddy if [ $ret -ne 0 ]; then
113 f259c4c1 2021-09-24 stsp diff -u $testroot/stderr.expected $testroot/stderr
114 f259c4c1 2021-09-24 stsp test_done "$testroot" "$ret"
118 f259c4c1 2021-09-24 stsp (cd $testroot/wt && got update > /dev/null)
120 49c543a6 2022-03-31 naddy if [ $ret -ne 0 ]; then
121 f259c4c1 2021-09-24 stsp echo "got update failed unexpectedly" >&2
122 f259c4c1 2021-09-24 stsp test_done "$testroot" "$ret"
126 5e91dae4 2022-08-30 stsp # must not have staged files with 'got merge'
127 f259c4c1 2021-09-24 stsp echo "modified file alpha" > $testroot/wt/alpha
128 f259c4c1 2021-09-24 stsp (cd $testroot/wt && got stage alpha > /dev/null)
130 49c543a6 2022-03-31 naddy if [ $ret -ne 0 ]; then
131 f259c4c1 2021-09-24 stsp echo "got stage failed unexpectedly" >&2
132 f259c4c1 2021-09-24 stsp test_done "$testroot" "$ret"
135 f259c4c1 2021-09-24 stsp (cd $testroot/wt && got merge newbranch \
136 f259c4c1 2021-09-24 stsp > $testroot/stdout 2> $testroot/stderr)
138 49c543a6 2022-03-31 naddy if [ $ret -eq 0 ]; then
139 f259c4c1 2021-09-24 stsp echo "got merge succeeded unexpectedly" >&2
140 ea4ee74a 2023-06-17 op test_done "$testroot" "1"
143 f259c4c1 2021-09-24 stsp echo "got: alpha: file is staged" > $testroot/stderr.expected
144 f259c4c1 2021-09-24 stsp cmp -s $testroot/stderr.expected $testroot/stderr
146 49c543a6 2022-03-31 naddy if [ $ret -ne 0 ]; then
147 f259c4c1 2021-09-24 stsp diff -u $testroot/stderr.expected $testroot/stderr
148 f259c4c1 2021-09-24 stsp test_done "$testroot" "$ret"
151 f259c4c1 2021-09-24 stsp (cd $testroot/wt && got unstage alpha > /dev/null)
153 49c543a6 2022-03-31 naddy if [ $ret -ne 0 ]; then
154 f259c4c1 2021-09-24 stsp echo "got unstage failed unexpectedly" >&2
155 f259c4c1 2021-09-24 stsp test_done "$testroot" "$ret"
159 5e91dae4 2022-08-30 stsp # must not have local changes with 'got merge'
160 f259c4c1 2021-09-24 stsp (cd $testroot/wt && got merge newbranch \
161 f259c4c1 2021-09-24 stsp > $testroot/stdout 2> $testroot/stderr)
163 49c543a6 2022-03-31 naddy if [ $ret -eq 0 ]; then
164 f259c4c1 2021-09-24 stsp echo "got merge succeeded unexpectedly" >&2
165 ea4ee74a 2023-06-17 op test_done "$testroot" "1"
168 f259c4c1 2021-09-24 stsp echo -n "got: work tree contains local changes; " \
169 f259c4c1 2021-09-24 stsp > $testroot/stderr.expected
170 f259c4c1 2021-09-24 stsp echo "these changes must be committed or reverted first" \
171 f259c4c1 2021-09-24 stsp >> $testroot/stderr.expected
172 f259c4c1 2021-09-24 stsp cmp -s $testroot/stderr.expected $testroot/stderr
174 49c543a6 2022-03-31 naddy if [ $ret -ne 0 ]; then
175 f259c4c1 2021-09-24 stsp diff -u $testroot/stderr.expected $testroot/stderr
176 f259c4c1 2021-09-24 stsp test_done "$testroot" "$ret"
180 f259c4c1 2021-09-24 stsp (cd $testroot/wt && got revert alpha > /dev/null)
182 49c543a6 2022-03-31 naddy if [ $ret -ne 0 ]; then
183 f259c4c1 2021-09-24 stsp echo "got revert failed unexpectedly" >&2
184 f259c4c1 2021-09-24 stsp test_done "$testroot" "$ret"
188 f259c4c1 2021-09-24 stsp (cd $testroot/wt && got merge newbranch > $testroot/stdout)
190 49c543a6 2022-03-31 naddy if [ $ret -ne 0 ]; then
191 f259c4c1 2021-09-24 stsp echo "got merge failed unexpectedly" >&2
192 f259c4c1 2021-09-24 stsp test_done "$testroot" "$ret"
196 f259c4c1 2021-09-24 stsp local merge_commit=`git_show_head $testroot/repo`
198 f259c4c1 2021-09-24 stsp echo "G alpha" >> $testroot/stdout.expected
199 f259c4c1 2021-09-24 stsp echo "D beta" >> $testroot/stdout.expected
200 5267b9e4 2021-09-26 stsp echo "A dotgotbar.link" >> $testroot/stdout.expected
201 f259c4c1 2021-09-24 stsp echo "A epsilon/new" >> $testroot/stdout.expected
202 f259c4c1 2021-09-24 stsp echo "G gamma/delta" >> $testroot/stdout.expected
203 f259c4c1 2021-09-24 stsp echo "A symlink" >> $testroot/stdout.expected
204 f259c4c1 2021-09-24 stsp echo -n "Merged refs/heads/newbranch into refs/heads/master: " \
205 f259c4c1 2021-09-24 stsp >> $testroot/stdout.expected
206 f259c4c1 2021-09-24 stsp echo $merge_commit >> $testroot/stdout.expected
208 f259c4c1 2021-09-24 stsp cmp -s $testroot/stdout.expected $testroot/stdout
210 49c543a6 2022-03-31 naddy if [ $ret -ne 0 ]; then
211 f259c4c1 2021-09-24 stsp diff -u $testroot/stdout.expected $testroot/stdout
212 f259c4c1 2021-09-24 stsp test_done "$testroot" "$ret"
216 f259c4c1 2021-09-24 stsp echo "modified delta on branch" > $testroot/content.expected
217 f259c4c1 2021-09-24 stsp cat $testroot/wt/gamma/delta > $testroot/content
218 f259c4c1 2021-09-24 stsp cmp -s $testroot/content.expected $testroot/content
220 49c543a6 2022-03-31 naddy if [ $ret -ne 0 ]; then
221 f259c4c1 2021-09-24 stsp diff -u $testroot/content.expected $testroot/content
222 f259c4c1 2021-09-24 stsp test_done "$testroot" "$ret"
226 f259c4c1 2021-09-24 stsp echo "modified alpha on branch" > $testroot/content.expected
227 f259c4c1 2021-09-24 stsp cat $testroot/wt/alpha > $testroot/content
228 f259c4c1 2021-09-24 stsp cmp -s $testroot/content.expected $testroot/content
230 49c543a6 2022-03-31 naddy if [ $ret -ne 0 ]; then
231 f259c4c1 2021-09-24 stsp diff -u $testroot/content.expected $testroot/content
232 f259c4c1 2021-09-24 stsp test_done "$testroot" "$ret"
236 f259c4c1 2021-09-24 stsp if [ -e $testroot/wt/beta ]; then
237 f259c4c1 2021-09-24 stsp echo "removed file beta still exists on disk" >&2
238 f259c4c1 2021-09-24 stsp test_done "$testroot" "1"
242 f259c4c1 2021-09-24 stsp echo "new file on branch" > $testroot/content.expected
243 f259c4c1 2021-09-24 stsp cat $testroot/wt/epsilon/new > $testroot/content
244 f259c4c1 2021-09-24 stsp cmp -s $testroot/content.expected $testroot/content
246 49c543a6 2022-03-31 naddy if [ $ret -ne 0 ]; then
247 f259c4c1 2021-09-24 stsp diff -u $testroot/content.expected $testroot/content
248 f259c4c1 2021-09-24 stsp test_done "$testroot" "$ret"
252 5267b9e4 2021-09-26 stsp if [ ! -h $testroot/wt/dotgotbar.link ]; then
253 5267b9e4 2021-09-26 stsp echo "dotgotbar.link is not a symlink"
254 5267b9e4 2021-09-26 stsp test_done "$testroot" "1"
258 f259c4c1 2021-09-24 stsp readlink $testroot/wt/symlink > $testroot/stdout
259 f259c4c1 2021-09-24 stsp echo "alpha" > $testroot/stdout.expected
260 f259c4c1 2021-09-24 stsp cmp -s $testroot/stdout.expected $testroot/stdout
262 49c543a6 2022-03-31 naddy if [ $ret -ne 0 ]; then
263 f259c4c1 2021-09-24 stsp diff -u $testroot/stdout.expected $testroot/stdout
264 f259c4c1 2021-09-24 stsp test_done "$testroot" "$ret"
268 f259c4c1 2021-09-24 stsp (cd $testroot/wt && got status > $testroot/stdout)
270 f259c4c1 2021-09-24 stsp echo -n > $testroot/stdout.expected
271 f259c4c1 2021-09-24 stsp cmp -s $testroot/stdout.expected $testroot/stdout
273 49c543a6 2022-03-31 naddy if [ $ret -ne 0 ]; then
274 f259c4c1 2021-09-24 stsp diff -u $testroot/stdout.expected $testroot/stdout
275 f259c4c1 2021-09-24 stsp test_done "$testroot" "$ret"
279 f259c4c1 2021-09-24 stsp (cd $testroot/wt && got log -l3 | grep ^commit > $testroot/stdout)
280 f259c4c1 2021-09-24 stsp echo "commit $merge_commit (master)" > $testroot/stdout.expected
281 f259c4c1 2021-09-24 stsp echo "commit $master_commit" >> $testroot/stdout.expected
282 f259c4c1 2021-09-24 stsp echo "commit $commit0" >> $testroot/stdout.expected
283 f259c4c1 2021-09-24 stsp cmp -s $testroot/stdout.expected $testroot/stdout
285 49c543a6 2022-03-31 naddy if [ $ret -ne 0 ]; then
286 f259c4c1 2021-09-24 stsp diff -u $testroot/stdout.expected $testroot/stdout
287 f259c4c1 2021-09-24 stsp test_done "$testroot" "$ret"
291 f259c4c1 2021-09-24 stsp (cd $testroot/wt && got update > $testroot/stdout)
293 5267b9e4 2021-09-26 stsp echo 'U dotgotbar.link' > $testroot/stdout.expected
294 5267b9e4 2021-09-26 stsp echo -n "Updated to refs/heads/master: " >> $testroot/stdout.expected
295 5267b9e4 2021-09-26 stsp git_show_head $testroot/repo >> $testroot/stdout.expected
296 5267b9e4 2021-09-26 stsp echo >> $testroot/stdout.expected
297 f259c4c1 2021-09-24 stsp cmp -s $testroot/stdout.expected $testroot/stdout
299 49c543a6 2022-03-31 naddy if [ $ret -ne 0 ]; then
300 f259c4c1 2021-09-24 stsp diff -u $testroot/stdout.expected $testroot/stdout
301 f259c4c1 2021-09-24 stsp test_done "$testroot" "$ret"
305 5267b9e4 2021-09-26 stsp # update has changed the bad symlink into a regular file
306 5267b9e4 2021-09-26 stsp if [ -h $testroot/wt/dotgotbar.link ]; then
307 5267b9e4 2021-09-26 stsp echo "dotgotbar.link is a symlink"
308 5267b9e4 2021-09-26 stsp test_done "$testroot" "1"
312 f259c4c1 2021-09-24 stsp # We should have created a merge commit with two parents.
313 f259c4c1 2021-09-24 stsp (cd $testroot/wt && got log -l1 | grep ^parent > $testroot/stdout)
314 f259c4c1 2021-09-24 stsp echo "parent 1: $master_commit" > $testroot/stdout.expected
315 5267b9e4 2021-09-26 stsp echo "parent 2: $branch_commit5" >> $testroot/stdout.expected
316 5267b9e4 2021-09-26 stsp cmp -s $testroot/stdout.expected $testroot/stdout
318 49c543a6 2022-03-31 naddy if [ $ret -ne 0 ]; then
319 5267b9e4 2021-09-26 stsp diff -u $testroot/stdout.expected $testroot/stdout
320 5267b9e4 2021-09-26 stsp test_done "$testroot" "$ret"
324 5267b9e4 2021-09-26 stsp got tree -r $testroot/repo -c $merge_commit -R > $testroot/stdout
326 49c543a6 2022-03-31 naddy if [ $ret -ne 0 ]; then
327 5267b9e4 2021-09-26 stsp echo "got tree failed unexpectedly" >&2
328 5267b9e4 2021-09-26 stsp test_done "$testroot" "$ret"
332 5267b9e4 2021-09-26 stsp # bad symlink dotgotbar.link appears as a symlink in the merge commit:
333 5267b9e4 2021-09-26 stsp cat > $testroot/stdout.expected <<EOF
335 5267b9e4 2021-09-26 stsp dotgotbar.link@ -> .got/bar
337 5267b9e4 2021-09-26 stsp epsilon/new
338 5267b9e4 2021-09-26 stsp epsilon/zeta
340 5267b9e4 2021-09-26 stsp gamma/delta
341 5267b9e4 2021-09-26 stsp symlink@ -> alpha
343 179f9db0 2023-06-20 falsifian cmp -s $testroot/stdout.expected $testroot/stdout
344 179f9db0 2023-06-20 falsifian ret=$?
345 179f9db0 2023-06-20 falsifian if [ $ret -ne 0 ]; then
346 179f9db0 2023-06-20 falsifian diff -u $testroot/stdout.expected $testroot/stdout
348 179f9db0 2023-06-20 falsifian test_done "$testroot" "$ret"
351 179f9db0 2023-06-20 falsifian test_merge_forward() {
352 179f9db0 2023-06-20 falsifian local testroot=`test_init merge_forward`
353 179f9db0 2023-06-20 falsifian local commit0=`git_show_head $testroot/repo`
355 179f9db0 2023-06-20 falsifian # Create a commit before branching, which will be used to help test
356 179f9db0 2023-06-20 falsifian # preconditions for "got merge".
357 179f9db0 2023-06-20 falsifian echo "modified alpha" > $testroot/repo/alpha
358 179f9db0 2023-06-20 falsifian git_commit $testroot/repo -m "common commit"
359 179f9db0 2023-06-20 falsifian local commit1=`git_show_head $testroot/repo`
361 f73bf5bd 2023-10-01 naddy git -C $testroot/repo checkout -q -b newbranch
362 179f9db0 2023-06-20 falsifian echo "modified beta on branch" > $testroot/repo/beta
363 179f9db0 2023-06-20 falsifian git_commit $testroot/repo -m "committing to beta on newbranch"
364 179f9db0 2023-06-20 falsifian local commit2=`git_show_head $testroot/repo`
366 179f9db0 2023-06-20 falsifian got checkout -b master $testroot/repo $testroot/wt > /dev/null
367 179f9db0 2023-06-20 falsifian ret=$?
368 179f9db0 2023-06-20 falsifian if [ $ret -ne 0 ]; then
369 179f9db0 2023-06-20 falsifian echo "got checkout failed unexpectedly" >&2
370 179f9db0 2023-06-20 falsifian test_done "$testroot" "$ret"
371 179f9db0 2023-06-20 falsifian return 1
374 179f9db0 2023-06-20 falsifian # must not use a mixed-commit work tree with 'got merge'
375 179f9db0 2023-06-20 falsifian (cd $testroot/wt && got update -c $commit0 alpha > /dev/null)
376 179f9db0 2023-06-20 falsifian ret=$?
377 179f9db0 2023-06-20 falsifian if [ $ret -ne 0 ]; then
378 179f9db0 2023-06-20 falsifian echo "got update failed unexpectedly" >&2
379 179f9db0 2023-06-20 falsifian test_done "$testroot" "$ret"
380 179f9db0 2023-06-20 falsifian return 1
382 179f9db0 2023-06-20 falsifian (cd $testroot/wt && got merge newbranch \
383 179f9db0 2023-06-20 falsifian > $testroot/stdout 2> $testroot/stderr)
384 179f9db0 2023-06-20 falsifian ret=$?
385 179f9db0 2023-06-20 falsifian if [ $ret -eq 0 ]; then
386 179f9db0 2023-06-20 falsifian echo "got merge succeeded unexpectedly" >&2
387 179f9db0 2023-06-20 falsifian test_done "$testroot" "$ret"
388 179f9db0 2023-06-20 falsifian return 1
390 179f9db0 2023-06-20 falsifian echo -n "got: work tree contains files from multiple base commits; " \
391 179f9db0 2023-06-20 falsifian > $testroot/stderr.expected
392 179f9db0 2023-06-20 falsifian echo "the entire work tree must be updated first" \
393 179f9db0 2023-06-20 falsifian >> $testroot/stderr.expected
394 179f9db0 2023-06-20 falsifian cmp -s $testroot/stderr.expected $testroot/stderr
395 179f9db0 2023-06-20 falsifian ret=$?
396 179f9db0 2023-06-20 falsifian if [ $ret -ne 0 ]; then
397 179f9db0 2023-06-20 falsifian diff -u $testroot/stderr.expected $testroot/stderr
398 179f9db0 2023-06-20 falsifian test_done "$testroot" "$ret"
399 179f9db0 2023-06-20 falsifian return 1
402 179f9db0 2023-06-20 falsifian (cd $testroot/wt && got update > /dev/null)
403 179f9db0 2023-06-20 falsifian ret=$?
404 179f9db0 2023-06-20 falsifian if [ $ret -ne 0 ]; then
405 179f9db0 2023-06-20 falsifian echo "got update failed unexpectedly" >&2
406 179f9db0 2023-06-20 falsifian test_done "$testroot" "$ret"
407 179f9db0 2023-06-20 falsifian return 1
410 179f9db0 2023-06-20 falsifian # 'got merge -n' refuses to fast-forward
411 179f9db0 2023-06-20 falsifian (cd $testroot/wt && got merge -n newbranch \
412 179f9db0 2023-06-20 falsifian > $testroot/stdout 2> $testroot/stderr)
413 179f9db0 2023-06-20 falsifian ret=$?
414 179f9db0 2023-06-20 falsifian if [ $ret -eq 0 ]; then
415 179f9db0 2023-06-20 falsifian echo "got merge succeeded unexpectedly" >&2
416 179f9db0 2023-06-20 falsifian test_done "$testroot" "1"
417 179f9db0 2023-06-20 falsifian return 1
420 f25e229e 2023-06-22 stsp echo -n "got: there are no changes to merge since " \
421 f25e229e 2023-06-22 stsp > $testroot/stderr.expected
422 f25e229e 2023-06-22 stsp echo -n "refs/heads/newbranch is already based on " \
423 179f9db0 2023-06-20 falsifian >> $testroot/stderr.expected
424 f25e229e 2023-06-22 stsp echo -n "refs/heads/master; merge cannot be interrupted " \
425 f25e229e 2023-06-22 stsp >> $testroot/stderr.expected
426 f25e229e 2023-06-22 stsp echo "for amending; -n: option cannot be used" \
427 f25e229e 2023-06-22 stsp >> $testroot/stderr.expected
429 179f9db0 2023-06-20 falsifian cmp -s $testroot/stderr.expected $testroot/stderr
430 179f9db0 2023-06-20 falsifian ret=$?
431 179f9db0 2023-06-20 falsifian if [ $ret -ne 0 ]; then
432 179f9db0 2023-06-20 falsifian diff -u $testroot/stderr.expected $testroot/stderr
433 179f9db0 2023-06-20 falsifian test_done "$testroot" "$ret"
434 179f9db0 2023-06-20 falsifian return 1
437 179f9db0 2023-06-20 falsifian (cd $testroot/wt && got merge newbranch \
438 179f9db0 2023-06-20 falsifian > $testroot/stdout 2> $testroot/stderr)
439 179f9db0 2023-06-20 falsifian ret=$?
440 179f9db0 2023-06-20 falsifian if [ $ret -ne 0 ]; then
441 179f9db0 2023-06-20 falsifian echo "got merge failed unexpectedly" >&2
442 179f9db0 2023-06-20 falsifian test_done "$testroot" "$ret"
443 179f9db0 2023-06-20 falsifian return 1
446 179f9db0 2023-06-20 falsifian echo "Forwarding refs/heads/master to refs/heads/newbranch" \
447 179f9db0 2023-06-20 falsifian > $testroot/stdout.expected
448 179f9db0 2023-06-20 falsifian echo "U beta" >> $testroot/stdout.expected
449 179f9db0 2023-06-20 falsifian echo "Updated to commit $commit2" \
450 179f9db0 2023-06-20 falsifian >> $testroot/stdout.expected
451 f259c4c1 2021-09-24 stsp cmp -s $testroot/stdout.expected $testroot/stdout
453 49c543a6 2022-03-31 naddy if [ $ret -ne 0 ]; then
454 f259c4c1 2021-09-24 stsp diff -u $testroot/stdout.expected $testroot/stdout
455 179f9db0 2023-06-20 falsifian test_done "$testroot" "$ret"
456 179f9db0 2023-06-20 falsifian return 1
459 179f9db0 2023-06-20 falsifian (cd $testroot/wt && got log | grep ^commit > $testroot/stdout)
460 179f9db0 2023-06-20 falsifian echo -n "commit $commit2 " > $testroot/stdout.expected
461 179f9db0 2023-06-20 falsifian echo "(master, newbranch)" >> $testroot/stdout.expected
462 179f9db0 2023-06-20 falsifian echo "commit $commit1" >> $testroot/stdout.expected
463 179f9db0 2023-06-20 falsifian echo "commit $commit0" >> $testroot/stdout.expected
464 481cdc74 2023-07-01 falsifian cmp -s $testroot/stdout.expected $testroot/stdout
465 481cdc74 2023-07-01 falsifian ret=$?
466 481cdc74 2023-07-01 falsifian if [ $ret -ne 0 ]; then
467 481cdc74 2023-07-01 falsifian diff -u $testroot/stdout.expected $testroot/stdout
468 481cdc74 2023-07-01 falsifian test_done "$testroot" "$ret"
469 481cdc74 2023-07-01 falsifian return 1
471 481cdc74 2023-07-01 falsifian test_done "$testroot" "$ret"
474 481cdc74 2023-07-01 falsifian test_merge_forward_commit() {
475 481cdc74 2023-07-01 falsifian local testroot=`test_init merge_forward_commit`
476 481cdc74 2023-07-01 falsifian local commit0=`git_show_head $testroot/repo`
478 f73bf5bd 2023-10-01 naddy git -C $testroot/repo checkout -q -b newbranch
479 481cdc74 2023-07-01 falsifian echo "modified alpha on branch" > $testroot/repo/alpha
480 481cdc74 2023-07-01 falsifian git_commit $testroot/repo -m "committing to alpha on newbranch"
481 481cdc74 2023-07-01 falsifian local commit1=`git_show_head $testroot/repo`
483 481cdc74 2023-07-01 falsifian got checkout -b master $testroot/repo $testroot/wt > /dev/null
484 481cdc74 2023-07-01 falsifian ret=$?
485 481cdc74 2023-07-01 falsifian if [ $ret -ne 0 ]; then
486 481cdc74 2023-07-01 falsifian echo "got checkout failed unexpectedly" >&2
487 481cdc74 2023-07-01 falsifian test_done "$testroot" "$ret"
488 481cdc74 2023-07-01 falsifian return 1
491 481cdc74 2023-07-01 falsifian (cd $testroot/wt && got merge -M newbranch > $testroot/stdout)
492 481cdc74 2023-07-01 falsifian ret=$?
493 481cdc74 2023-07-01 falsifian if [ $ret -ne 0 ]; then
494 481cdc74 2023-07-01 falsifian echo "got merge failed unexpectedly" >&2
495 481cdc74 2023-07-01 falsifian test_done "$testroot" "$ret"
496 481cdc74 2023-07-01 falsifian return 1
499 481cdc74 2023-07-01 falsifian local merge_commit=`git_show_branch_head $testroot/repo master`
501 481cdc74 2023-07-01 falsifian echo "G alpha" >> $testroot/stdout.expected
502 481cdc74 2023-07-01 falsifian echo -n "Merged refs/heads/newbranch into refs/heads/master: " \
503 481cdc74 2023-07-01 falsifian >> $testroot/stdout.expected
504 481cdc74 2023-07-01 falsifian echo $merge_commit >> $testroot/stdout.expected
506 481cdc74 2023-07-01 falsifian cmp -s $testroot/stdout.expected $testroot/stdout
507 481cdc74 2023-07-01 falsifian ret=$?
508 481cdc74 2023-07-01 falsifian if [ $ret -ne 0 ]; then
509 481cdc74 2023-07-01 falsifian diff -u $testroot/stdout.expected $testroot/stdout
510 481cdc74 2023-07-01 falsifian test_done "$testroot" "$ret"
511 481cdc74 2023-07-01 falsifian return 1
514 481cdc74 2023-07-01 falsifian # We should have created a merge commit with two parents.
515 481cdc74 2023-07-01 falsifian (cd $testroot/wt && got log -l1 | grep ^parent > $testroot/stdout)
516 481cdc74 2023-07-01 falsifian echo "parent 1: $commit0" > $testroot/stdout.expected
517 481cdc74 2023-07-01 falsifian echo "parent 2: $commit1" >> $testroot/stdout.expected
518 481cdc74 2023-07-01 falsifian cmp -s $testroot/stdout.expected $testroot/stdout
519 481cdc74 2023-07-01 falsifian ret=$?
520 481cdc74 2023-07-01 falsifian if [ $ret -ne 0 ]; then
521 481cdc74 2023-07-01 falsifian diff -u $testroot/stdout.expected $testroot/stdout
522 481cdc74 2023-07-01 falsifian test_done "$testroot" "$ret"
523 481cdc74 2023-07-01 falsifian return 1
526 481cdc74 2023-07-01 falsifian test_done "$testroot" "$ret"
529 481cdc74 2023-07-01 falsifian test_merge_forward_interrupt() {
530 481cdc74 2023-07-01 falsifian # Test -M and -n options together.
531 481cdc74 2023-07-01 falsifian local testroot=`test_init merge_forward_commit`
532 481cdc74 2023-07-01 falsifian local commit0=`git_show_head $testroot/repo`
534 f73bf5bd 2023-10-01 naddy git -C $testroot/repo checkout -q -b newbranch
535 481cdc74 2023-07-01 falsifian echo "modified alpha on branch" > $testroot/repo/alpha
536 481cdc74 2023-07-01 falsifian git_commit $testroot/repo -m "committing to alpha on newbranch"
537 481cdc74 2023-07-01 falsifian local commit1=`git_show_head $testroot/repo`
539 481cdc74 2023-07-01 falsifian got checkout -b master $testroot/repo $testroot/wt > /dev/null
540 481cdc74 2023-07-01 falsifian ret=$?
541 481cdc74 2023-07-01 falsifian if [ $ret -ne 0 ]; then
542 481cdc74 2023-07-01 falsifian echo "got checkout failed unexpectedly" >&2
543 481cdc74 2023-07-01 falsifian test_done "$testroot" "$ret"
544 481cdc74 2023-07-01 falsifian return 1
547 481cdc74 2023-07-01 falsifian (cd $testroot/wt && got merge -M -n newbranch > $testroot/stdout)
548 481cdc74 2023-07-01 falsifian ret=$?
549 481cdc74 2023-07-01 falsifian if [ $ret -ne 0 ]; then
550 481cdc74 2023-07-01 falsifian echo "got merge failed unexpectedly" >&2
551 481cdc74 2023-07-01 falsifian test_done "$testroot" "$ret"
552 481cdc74 2023-07-01 falsifian return 1
555 481cdc74 2023-07-01 falsifian echo "G alpha" > $testroot/stdout.expected
556 481cdc74 2023-07-01 falsifian echo "Merge of refs/heads/newbranch interrupted on request" \
557 481cdc74 2023-07-01 falsifian >> $testroot/stdout.expected
558 481cdc74 2023-07-01 falsifian cmp -s $testroot/stdout.expected $testroot/stdout
559 481cdc74 2023-07-01 falsifian ret=$?
560 481cdc74 2023-07-01 falsifian if [ $ret -ne 0 ]; then
561 481cdc74 2023-07-01 falsifian diff -u $testroot/stdout.expected $testroot/stdout
562 481cdc74 2023-07-01 falsifian test_done "$testroot" "$ret"
563 481cdc74 2023-07-01 falsifian return 1
566 481cdc74 2023-07-01 falsifian # Continue the merge.
567 481cdc74 2023-07-01 falsifian (cd $testroot/wt && got merge -c > $testroot/stdout)
568 481cdc74 2023-07-01 falsifian ret=$?
569 481cdc74 2023-07-01 falsifian if [ $ret -ne 0 ]; then
570 481cdc74 2023-07-01 falsifian echo "got merge failed unexpectedly" >&2
571 481cdc74 2023-07-01 falsifian test_done "$testroot" "$ret"
572 481cdc74 2023-07-01 falsifian return 1
575 481cdc74 2023-07-01 falsifian local merge_commit=`git_show_branch_head $testroot/repo master`
577 481cdc74 2023-07-01 falsifian echo "M alpha" > $testroot/stdout.expected
578 481cdc74 2023-07-01 falsifian echo -n "Merged refs/heads/newbranch into refs/heads/master: " \
579 481cdc74 2023-07-01 falsifian >> $testroot/stdout.expected
580 481cdc74 2023-07-01 falsifian echo $merge_commit >> $testroot/stdout.expected
582 179f9db0 2023-06-20 falsifian cmp -s $testroot/stdout.expected $testroot/stdout
583 179f9db0 2023-06-20 falsifian ret=$?
584 179f9db0 2023-06-20 falsifian if [ $ret -ne 0 ]; then
585 179f9db0 2023-06-20 falsifian diff -u $testroot/stdout.expected $testroot/stdout
586 179f9db0 2023-06-20 falsifian test_done "$testroot" "$ret"
587 179f9db0 2023-06-20 falsifian return 1
590 481cdc74 2023-07-01 falsifian # We should have created a merge commit with two parents.
591 481cdc74 2023-07-01 falsifian (cd $testroot/wt && got log -l1 | grep ^parent > $testroot/stdout)
592 481cdc74 2023-07-01 falsifian echo "parent 1: $commit0" > $testroot/stdout.expected
593 481cdc74 2023-07-01 falsifian echo "parent 2: $commit1" >> $testroot/stdout.expected
594 481cdc74 2023-07-01 falsifian cmp -s $testroot/stdout.expected $testroot/stdout
595 481cdc74 2023-07-01 falsifian ret=$?
596 481cdc74 2023-07-01 falsifian if [ $ret -ne 0 ]; then
597 481cdc74 2023-07-01 falsifian diff -u $testroot/stdout.expected $testroot/stdout
599 179f9db0 2023-06-20 falsifian test_done "$testroot" "$ret"
602 179f9db0 2023-06-20 falsifian test_merge_backward() {
603 179f9db0 2023-06-20 falsifian local testroot=`test_init merge_backward`
604 179f9db0 2023-06-20 falsifian local commit0=`git_show_head $testroot/repo`
606 f73bf5bd 2023-10-01 naddy git -C $testroot/repo checkout -q -b newbranch
607 f73bf5bd 2023-10-01 naddy git -C $testroot/repo checkout -q master
608 179f9db0 2023-06-20 falsifian echo "modified alpha on master" > $testroot/repo/alpha
609 179f9db0 2023-06-20 falsifian git_commit $testroot/repo -m "committing to alpha on master"
611 179f9db0 2023-06-20 falsifian got checkout -b master $testroot/repo $testroot/wt > /dev/null
612 179f9db0 2023-06-20 falsifian ret=$?
613 179f9db0 2023-06-20 falsifian if [ $ret -ne 0 ]; then
614 179f9db0 2023-06-20 falsifian echo "got checkout failed unexpectedly" >&2
615 179f9db0 2023-06-20 falsifian test_done "$testroot" "$ret"
616 179f9db0 2023-06-20 falsifian return 1
619 179f9db0 2023-06-20 falsifian (cd $testroot/wt && got merge newbranch \
620 179f9db0 2023-06-20 falsifian > $testroot/stdout 2> $testroot/stderr)
621 179f9db0 2023-06-20 falsifian ret=$?
622 179f9db0 2023-06-20 falsifian if [ $ret -ne 0 ]; then
623 179f9db0 2023-06-20 falsifian echo "got merge failed unexpectedly" >&2
624 179f9db0 2023-06-20 falsifian test_done "$testroot" "$ret"
625 179f9db0 2023-06-20 falsifian return 1
627 179f9db0 2023-06-20 falsifian echo "Already up-to-date" > $testroot/stdout.expected
628 179f9db0 2023-06-20 falsifian cmp -s $testroot/stdout.expected $testroot/stdout
629 179f9db0 2023-06-20 falsifian ret=$?
630 179f9db0 2023-06-20 falsifian if [ $ret -ne 0 ]; then
631 179f9db0 2023-06-20 falsifian diff -u $testroot/stdout.expected $testroot/stdout
632 179f9db0 2023-06-20 falsifian test_done "$testroot" "$ret"
633 179f9db0 2023-06-20 falsifian return 1
635 f259c4c1 2021-09-24 stsp test_done "$testroot" "$ret"
638 f259c4c1 2021-09-24 stsp test_merge_continue() {
639 f259c4c1 2021-09-24 stsp local testroot=`test_init merge_continue`
640 f259c4c1 2021-09-24 stsp local commit0=`git_show_head $testroot/repo`
641 f259c4c1 2021-09-24 stsp local commit0_author_time=`git_show_author_time $testroot/repo`
643 f73bf5bd 2023-10-01 naddy git -C $testroot/repo checkout -q -b newbranch
644 f259c4c1 2021-09-24 stsp echo "modified delta on branch" > $testroot/repo/gamma/delta
645 f259c4c1 2021-09-24 stsp git_commit $testroot/repo -m "committing to delta on newbranch"
646 f259c4c1 2021-09-24 stsp local branch_commit0=`git_show_branch_head $testroot/repo newbranch`
648 f259c4c1 2021-09-24 stsp echo "modified alpha on branch" > $testroot/repo/alpha
649 f259c4c1 2021-09-24 stsp git_commit $testroot/repo -m "committing to alpha on newbranch"
650 f259c4c1 2021-09-24 stsp local branch_commit1=`git_show_branch_head $testroot/repo newbranch`
651 f73bf5bd 2023-10-01 naddy git -C $testroot/repo rm -q beta
652 f259c4c1 2021-09-24 stsp git_commit $testroot/repo -m "removing beta on newbranch"
653 f259c4c1 2021-09-24 stsp local branch_commit2=`git_show_branch_head $testroot/repo newbranch`
654 f259c4c1 2021-09-24 stsp echo "new file on branch" > $testroot/repo/epsilon/new
655 f73bf5bd 2023-10-01 naddy git -C $testroot/repo add epsilon/new
656 f259c4c1 2021-09-24 stsp git_commit $testroot/repo -m "adding new file on newbranch"
657 f259c4c1 2021-09-24 stsp local branch_commit3=`git_show_branch_head $testroot/repo newbranch`
659 f259c4c1 2021-09-24 stsp got checkout -b master $testroot/repo $testroot/wt > /dev/null
661 49c543a6 2022-03-31 naddy if [ $ret -ne 0 ]; then
662 f259c4c1 2021-09-24 stsp echo "got checkout failed unexpectedly" >&2
663 f259c4c1 2021-09-24 stsp test_done "$testroot" "$ret"
667 f259c4c1 2021-09-24 stsp # create a conflicting commit
668 f73bf5bd 2023-10-01 naddy git -C $testroot/repo checkout -q master
669 f259c4c1 2021-09-24 stsp echo "modified alpha on master" > $testroot/repo/alpha
670 f259c4c1 2021-09-24 stsp git_commit $testroot/repo -m "committing to alpha on master"
671 f259c4c1 2021-09-24 stsp local master_commit=`git_show_head $testroot/repo`
673 5e91dae4 2022-08-30 stsp # need an up-to-date work tree for 'got merge'
674 f259c4c1 2021-09-24 stsp (cd $testroot/wt && got update > /dev/null)
676 49c543a6 2022-03-31 naddy if [ $ret -ne 0 ]; then
677 f259c4c1 2021-09-24 stsp echo "got update failed unexpectedly" >&2
678 f259c4c1 2021-09-24 stsp test_done "$testroot" "$ret"
682 f259c4c1 2021-09-24 stsp (cd $testroot/wt && got merge newbranch \
683 f259c4c1 2021-09-24 stsp > $testroot/stdout 2> $testroot/stderr)
685 49c543a6 2022-03-31 naddy if [ $ret -eq 0 ]; then
686 f259c4c1 2021-09-24 stsp echo "got merge succeeded unexpectedly" >&2
687 f259c4c1 2021-09-24 stsp test_done "$testroot" "1"
691 f259c4c1 2021-09-24 stsp echo "C alpha" >> $testroot/stdout.expected
692 f259c4c1 2021-09-24 stsp echo "D beta" >> $testroot/stdout.expected
693 f259c4c1 2021-09-24 stsp echo "A epsilon/new" >> $testroot/stdout.expected
694 f259c4c1 2021-09-24 stsp echo "G gamma/delta" >> $testroot/stdout.expected
695 f259c4c1 2021-09-24 stsp echo "Files with new merge conflicts: 1" >> $testroot/stdout.expected
696 f259c4c1 2021-09-24 stsp cmp -s $testroot/stdout.expected $testroot/stdout
698 49c543a6 2022-03-31 naddy if [ $ret -ne 0 ]; then
699 f259c4c1 2021-09-24 stsp diff -u $testroot/stdout.expected $testroot/stdout
700 f259c4c1 2021-09-24 stsp test_done "$testroot" "$ret"
704 f259c4c1 2021-09-24 stsp echo "got: conflicts must be resolved before merging can continue" \
705 f259c4c1 2021-09-24 stsp > $testroot/stderr.expected
706 f259c4c1 2021-09-24 stsp cmp -s $testroot/stderr.expected $testroot/stderr
708 49c543a6 2022-03-31 naddy if [ $ret -ne 0 ]; then
709 f259c4c1 2021-09-24 stsp diff -u $testroot/stderr.expected $testroot/stderr
710 f259c4c1 2021-09-24 stsp test_done "$testroot" "$ret"
714 f259c4c1 2021-09-24 stsp (cd $testroot/wt && got status > $testroot/stdout)
716 f259c4c1 2021-09-24 stsp echo "C alpha" > $testroot/stdout.expected
717 f259c4c1 2021-09-24 stsp echo "D beta" >> $testroot/stdout.expected
718 f259c4c1 2021-09-24 stsp echo "A epsilon/new" >> $testroot/stdout.expected
719 f259c4c1 2021-09-24 stsp echo "M gamma/delta" >> $testroot/stdout.expected
720 f259c4c1 2021-09-24 stsp cmp -s $testroot/stdout.expected $testroot/stdout
722 49c543a6 2022-03-31 naddy if [ $ret -ne 0 ]; then
723 f259c4c1 2021-09-24 stsp diff -u $testroot/stdout.expected $testroot/stdout
724 f259c4c1 2021-09-24 stsp test_done "$testroot" "$ret"
728 f259c4c1 2021-09-24 stsp echo '<<<<<<<' > $testroot/content.expected
729 f259c4c1 2021-09-24 stsp echo "modified alpha on master" >> $testroot/content.expected
730 f259c4c1 2021-09-24 stsp echo "||||||| 3-way merge base: commit $commit0" \
731 f259c4c1 2021-09-24 stsp >> $testroot/content.expected
732 f259c4c1 2021-09-24 stsp echo "alpha" >> $testroot/content.expected
733 f259c4c1 2021-09-24 stsp echo "=======" >> $testroot/content.expected
734 f259c4c1 2021-09-24 stsp echo "modified alpha on branch" >> $testroot/content.expected
735 f259c4c1 2021-09-24 stsp echo ">>>>>>> merged change: commit $branch_commit3" \
736 f259c4c1 2021-09-24 stsp >> $testroot/content.expected
737 f259c4c1 2021-09-24 stsp cat $testroot/wt/alpha > $testroot/content
738 f259c4c1 2021-09-24 stsp cmp -s $testroot/content.expected $testroot/content
740 49c543a6 2022-03-31 naddy if [ $ret -ne 0 ]; then
741 f259c4c1 2021-09-24 stsp diff -u $testroot/content.expected $testroot/content
742 f259c4c1 2021-09-24 stsp test_done "$testroot" "$ret"
746 f259c4c1 2021-09-24 stsp # resolve the conflict
747 f259c4c1 2021-09-24 stsp echo "modified alpha by both branches" > $testroot/wt/alpha
749 f259c4c1 2021-09-24 stsp (cd $testroot/wt && got merge -c > $testroot/stdout)
751 49c543a6 2022-03-31 naddy if [ $ret -ne 0 ]; then
752 f259c4c1 2021-09-24 stsp echo "got merge failed unexpectedly" >&2
753 f259c4c1 2021-09-24 stsp test_done "$testroot" "$ret"
757 f259c4c1 2021-09-24 stsp local merge_commit=`git_show_head $testroot/repo`
759 0ff8d236 2021-09-28 stsp echo "M alpha" > $testroot/stdout.expected
760 0ff8d236 2021-09-28 stsp echo "D beta" >> $testroot/stdout.expected
761 0ff8d236 2021-09-28 stsp echo "A epsilon/new" >> $testroot/stdout.expected
762 0ff8d236 2021-09-28 stsp echo "M gamma/delta" >> $testroot/stdout.expected
763 f259c4c1 2021-09-24 stsp echo -n "Merged refs/heads/newbranch into refs/heads/master: " \
764 0ff8d236 2021-09-28 stsp >> $testroot/stdout.expected
765 f259c4c1 2021-09-24 stsp echo $merge_commit >> $testroot/stdout.expected
767 f259c4c1 2021-09-24 stsp cmp -s $testroot/stdout.expected $testroot/stdout
769 49c543a6 2022-03-31 naddy if [ $ret -ne 0 ]; then
770 f259c4c1 2021-09-24 stsp diff -u $testroot/stdout.expected $testroot/stdout
771 f259c4c1 2021-09-24 stsp test_done "$testroot" "$ret"
775 f259c4c1 2021-09-24 stsp echo "modified delta on branch" > $testroot/content.expected
776 f259c4c1 2021-09-24 stsp cat $testroot/wt/gamma/delta > $testroot/content
777 f259c4c1 2021-09-24 stsp cmp -s $testroot/content.expected $testroot/content
779 49c543a6 2022-03-31 naddy if [ $ret -ne 0 ]; then
780 f259c4c1 2021-09-24 stsp diff -u $testroot/content.expected $testroot/content
781 f259c4c1 2021-09-24 stsp test_done "$testroot" "$ret"
785 f259c4c1 2021-09-24 stsp echo "modified alpha by both branches" > $testroot/content.expected
786 f259c4c1 2021-09-24 stsp cat $testroot/wt/alpha > $testroot/content
787 f259c4c1 2021-09-24 stsp cmp -s $testroot/content.expected $testroot/content
789 49c543a6 2022-03-31 naddy if [ $ret -ne 0 ]; then
790 f259c4c1 2021-09-24 stsp diff -u $testroot/content.expected $testroot/content
791 f259c4c1 2021-09-24 stsp test_done "$testroot" "$ret"
795 f259c4c1 2021-09-24 stsp if [ -e $testroot/wt/beta ]; then
796 f259c4c1 2021-09-24 stsp echo "removed file beta still exists on disk" >&2
797 f259c4c1 2021-09-24 stsp test_done "$testroot" "1"
801 f259c4c1 2021-09-24 stsp echo "new file on branch" > $testroot/content.expected
802 f259c4c1 2021-09-24 stsp cat $testroot/wt/epsilon/new > $testroot/content
803 f259c4c1 2021-09-24 stsp cmp -s $testroot/content.expected $testroot/content
805 49c543a6 2022-03-31 naddy if [ $ret -ne 0 ]; then
806 f259c4c1 2021-09-24 stsp diff -u $testroot/content.expected $testroot/content
807 f259c4c1 2021-09-24 stsp test_done "$testroot" "$ret"
811 f259c4c1 2021-09-24 stsp (cd $testroot/wt && got status > $testroot/stdout)
813 f259c4c1 2021-09-24 stsp echo -n > $testroot/stdout.expected
814 f259c4c1 2021-09-24 stsp cmp -s $testroot/stdout.expected $testroot/stdout
816 49c543a6 2022-03-31 naddy if [ $ret -ne 0 ]; then
817 f259c4c1 2021-09-24 stsp diff -u $testroot/stdout.expected $testroot/stdout
818 f259c4c1 2021-09-24 stsp test_done "$testroot" "$ret"
822 f259c4c1 2021-09-24 stsp (cd $testroot/wt && got log -l3 | grep ^commit > $testroot/stdout)
823 f259c4c1 2021-09-24 stsp echo "commit $merge_commit (master)" > $testroot/stdout.expected
824 f259c4c1 2021-09-24 stsp echo "commit $master_commit" >> $testroot/stdout.expected
825 f259c4c1 2021-09-24 stsp echo "commit $commit0" >> $testroot/stdout.expected
826 f259c4c1 2021-09-24 stsp cmp -s $testroot/stdout.expected $testroot/stdout
828 49c543a6 2022-03-31 naddy if [ $ret -ne 0 ]; then
829 f259c4c1 2021-09-24 stsp diff -u $testroot/stdout.expected $testroot/stdout
830 f259c4c1 2021-09-24 stsp test_done "$testroot" "$ret"
834 f259c4c1 2021-09-24 stsp (cd $testroot/wt && got update > $testroot/stdout)
836 f259c4c1 2021-09-24 stsp echo 'Already up-to-date' > $testroot/stdout.expected
837 f259c4c1 2021-09-24 stsp cmp -s $testroot/stdout.expected $testroot/stdout
839 49c543a6 2022-03-31 naddy if [ $ret -ne 0 ]; then
840 f259c4c1 2021-09-24 stsp diff -u $testroot/stdout.expected $testroot/stdout
841 f259c4c1 2021-09-24 stsp test_done "$testroot" "$ret"
845 f259c4c1 2021-09-24 stsp # We should have created a merge commit with two parents.
846 f259c4c1 2021-09-24 stsp (cd $testroot/wt && got log -l1 | grep ^parent > $testroot/stdout)
847 f259c4c1 2021-09-24 stsp echo "parent 1: $master_commit" > $testroot/stdout.expected
848 f259c4c1 2021-09-24 stsp echo "parent 2: $branch_commit3" >> $testroot/stdout.expected
849 6b5246e4 2023-06-05 stsp cmp -s $testroot/stdout.expected $testroot/stdout
851 6b5246e4 2023-06-05 stsp if [ $ret -ne 0 ]; then
852 6b5246e4 2023-06-05 stsp diff -u $testroot/stdout.expected $testroot/stdout
854 6b5246e4 2023-06-05 stsp test_done "$testroot" "$ret"
857 6b5246e4 2023-06-05 stsp test_merge_continue_new_commit() {
858 6b5246e4 2023-06-05 stsp # "got merge -c" should refuse to run if the current branch tip has
859 6b5246e4 2023-06-05 stsp # changed since the merge was started, to avoid clobbering the changes.
860 6b5246e4 2023-06-05 stsp local testroot=`test_init merge_continue_new_commit`
862 f73bf5bd 2023-10-01 naddy git -C $testroot/repo checkout -q -b newbranch
863 6b5246e4 2023-06-05 stsp echo "modified delta on branch" > $testroot/repo/gamma/delta
864 6b5246e4 2023-06-05 stsp git_commit $testroot/repo -m "committing to delta on newbranch"
866 f73bf5bd 2023-10-01 naddy git -C $testroot/repo checkout -q master
867 6b5246e4 2023-06-05 stsp echo "modified alpha on master" > $testroot/repo/alpha
868 6b5246e4 2023-06-05 stsp git_commit $testroot/repo -m "committing to alpha on master"
870 6b5246e4 2023-06-05 stsp got checkout -b master $testroot/repo $testroot/wt > /dev/null
872 6b5246e4 2023-06-05 stsp if [ $ret -ne 0 ]; then
873 6b5246e4 2023-06-05 stsp echo "got checkout failed unexpectedly" >&2
874 6b5246e4 2023-06-05 stsp test_done "$testroot" "$ret"
878 6b5246e4 2023-06-05 stsp (cd $testroot/wt && got merge -n newbranch >/dev/null)
880 6b5246e4 2023-06-05 stsp if [ $ret -ne 0 ]; then
881 6b5246e4 2023-06-05 stsp echo "got merge failed unexpectedly" >&2
882 6b5246e4 2023-06-05 stsp test_done "$testroot" "$ret"
886 6b5246e4 2023-06-05 stsp echo "modified alpha again on master" > $testroot/repo/alpha
887 6b5246e4 2023-06-05 stsp git_commit $testroot/repo -m "committing to alpha on master again"
889 6b5246e4 2023-06-05 stsp (cd $testroot/wt && got merge -c > $testroot/stdout 2> $testroot/stderr)
891 6b5246e4 2023-06-05 stsp if [ $ret -eq 0 ]; then
892 6b5246e4 2023-06-05 stsp echo "got merge succeeded unexpectedly" >&2
893 6b5246e4 2023-06-05 stsp test_done "$testroot" "1"
897 6b5246e4 2023-06-05 stsp echo -n > $testroot/stdout.expected
898 f259c4c1 2021-09-24 stsp cmp -s $testroot/stdout.expected $testroot/stdout
900 49c543a6 2022-03-31 naddy if [ $ret -ne 0 ]; then
901 f259c4c1 2021-09-24 stsp diff -u $testroot/stdout.expected $testroot/stdout
902 6b5246e4 2023-06-05 stsp test_done "$testroot" "$ret"
906 6b5246e4 2023-06-05 stsp echo -n "got: merging cannot proceed because the work tree is no " \
907 6b5246e4 2023-06-05 stsp > $testroot/stderr.expected
908 6b5246e4 2023-06-05 stsp echo "longer up-to-date; merge must be aborted and retried" \
909 6b5246e4 2023-06-05 stsp >> $testroot/stderr.expected
910 6b5246e4 2023-06-05 stsp cmp -s $testroot/stderr.expected $testroot/stderr
912 6b5246e4 2023-06-05 stsp if [ $ret -ne 0 ]; then
913 6b5246e4 2023-06-05 stsp diff -u $testroot/stderr.expected $testroot/stderr
915 f259c4c1 2021-09-24 stsp test_done "$testroot" "$ret"
918 f259c4c1 2021-09-24 stsp test_merge_abort() {
919 f259c4c1 2021-09-24 stsp local testroot=`test_init merge_abort`
920 f259c4c1 2021-09-24 stsp local commit0=`git_show_head $testroot/repo`
921 f259c4c1 2021-09-24 stsp local commit0_author_time=`git_show_author_time $testroot/repo`
923 f73bf5bd 2023-10-01 naddy git -C $testroot/repo checkout -q -b newbranch
924 f259c4c1 2021-09-24 stsp echo "modified delta on branch" > $testroot/repo/gamma/delta
925 f259c4c1 2021-09-24 stsp git_commit $testroot/repo -m "committing to delta on newbranch"
926 f259c4c1 2021-09-24 stsp local branch_commit0=`git_show_branch_head $testroot/repo newbranch`
928 f259c4c1 2021-09-24 stsp echo "modified alpha on branch" > $testroot/repo/alpha
929 f259c4c1 2021-09-24 stsp git_commit $testroot/repo -m "committing to alpha on newbranch"
930 f259c4c1 2021-09-24 stsp local branch_commit1=`git_show_branch_head $testroot/repo newbranch`
931 f73bf5bd 2023-10-01 naddy git -C $testroot/repo rm -q beta
932 f259c4c1 2021-09-24 stsp git_commit $testroot/repo -m "removing beta on newbranch"
933 f259c4c1 2021-09-24 stsp local branch_commit2=`git_show_branch_head $testroot/repo newbranch`
934 f259c4c1 2021-09-24 stsp echo "new file on branch" > $testroot/repo/epsilon/new
935 f73bf5bd 2023-10-01 naddy git -C $testroot/repo add epsilon/new
936 f259c4c1 2021-09-24 stsp git_commit $testroot/repo -m "adding new file on newbranch"
937 f259c4c1 2021-09-24 stsp local branch_commit3=`git_show_branch_head $testroot/repo newbranch`
938 f73bf5bd 2023-10-01 naddy (cd $testroot/repo && ln -s alpha symlink)
939 f73bf5bd 2023-10-01 naddy git -C $testroot/repo add symlink
940 f259c4c1 2021-09-24 stsp git_commit $testroot/repo -m "adding symlink on newbranch"
941 f259c4c1 2021-09-24 stsp local branch_commit4=`git_show_branch_head $testroot/repo newbranch`
943 f259c4c1 2021-09-24 stsp got checkout -b master $testroot/repo $testroot/wt > /dev/null
945 49c543a6 2022-03-31 naddy if [ $ret -ne 0 ]; then
946 f259c4c1 2021-09-24 stsp echo "got checkout failed unexpectedly" >&2
947 f259c4c1 2021-09-24 stsp test_done "$testroot" "$ret"
951 41f061b2 2021-10-05 stsp # unrelated unversioned file in work tree
952 41f061b2 2021-10-05 stsp touch $testroot/wt/unversioned-file
954 f259c4c1 2021-09-24 stsp # create a conflicting commit
955 f73bf5bd 2023-10-01 naddy git -C $testroot/repo checkout -q master
956 f259c4c1 2021-09-24 stsp echo "modified alpha on master" > $testroot/repo/alpha
957 f259c4c1 2021-09-24 stsp git_commit $testroot/repo -m "committing to alpha on master"
958 f259c4c1 2021-09-24 stsp local master_commit=`git_show_head $testroot/repo`
960 5e91dae4 2022-08-30 stsp # need an up-to-date work tree for 'got merge'
961 f259c4c1 2021-09-24 stsp (cd $testroot/wt && got update > /dev/null)
963 49c543a6 2022-03-31 naddy if [ $ret -ne 0 ]; then
964 f259c4c1 2021-09-24 stsp echo "got update failed unexpectedly" >&2
965 f259c4c1 2021-09-24 stsp test_done "$testroot" "$ret"
969 f259c4c1 2021-09-24 stsp (cd $testroot/wt && got merge newbranch \
970 f259c4c1 2021-09-24 stsp > $testroot/stdout 2> $testroot/stderr)
972 49c543a6 2022-03-31 naddy if [ $ret -eq 0 ]; then
973 f259c4c1 2021-09-24 stsp echo "got merge succeeded unexpectedly" >&2
974 f259c4c1 2021-09-24 stsp test_done "$testroot" "1"
978 f259c4c1 2021-09-24 stsp echo "C alpha" >> $testroot/stdout.expected
979 f259c4c1 2021-09-24 stsp echo "D beta" >> $testroot/stdout.expected
980 f259c4c1 2021-09-24 stsp echo "A epsilon/new" >> $testroot/stdout.expected
981 f259c4c1 2021-09-24 stsp echo "G gamma/delta" >> $testroot/stdout.expected
982 f259c4c1 2021-09-24 stsp echo "A symlink" >> $testroot/stdout.expected
983 f259c4c1 2021-09-24 stsp echo "Files with new merge conflicts: 1" >> $testroot/stdout.expected
984 f259c4c1 2021-09-24 stsp cmp -s $testroot/stdout.expected $testroot/stdout
986 49c543a6 2022-03-31 naddy if [ $ret -ne 0 ]; then
987 f259c4c1 2021-09-24 stsp diff -u $testroot/stdout.expected $testroot/stdout
988 f259c4c1 2021-09-24 stsp test_done "$testroot" "$ret"
992 f259c4c1 2021-09-24 stsp echo "got: conflicts must be resolved before merging can continue" \
993 f259c4c1 2021-09-24 stsp > $testroot/stderr.expected
994 f259c4c1 2021-09-24 stsp cmp -s $testroot/stderr.expected $testroot/stderr
996 49c543a6 2022-03-31 naddy if [ $ret -ne 0 ]; then
997 f259c4c1 2021-09-24 stsp diff -u $testroot/stderr.expected $testroot/stderr
998 f259c4c1 2021-09-24 stsp test_done "$testroot" "$ret"
1002 af179be7 2023-04-14 stsp # unrelated added file added during conflict resolution
1003 af179be7 2023-04-14 stsp touch $testroot/wt/added-file
1004 af179be7 2023-04-14 stsp (cd $testroot/wt && got add added-file > /dev/null)
1006 f259c4c1 2021-09-24 stsp (cd $testroot/wt && got status > $testroot/stdout)
1008 af179be7 2023-04-14 stsp echo "A added-file" > $testroot/stdout.expected
1009 af179be7 2023-04-14 stsp echo "C alpha" >> $testroot/stdout.expected
1010 f259c4c1 2021-09-24 stsp echo "D beta" >> $testroot/stdout.expected
1011 f259c4c1 2021-09-24 stsp echo "A epsilon/new" >> $testroot/stdout.expected
1012 f259c4c1 2021-09-24 stsp echo "M gamma/delta" >> $testroot/stdout.expected
1013 f259c4c1 2021-09-24 stsp echo "A symlink" >> $testroot/stdout.expected
1014 41f061b2 2021-10-05 stsp echo "? unversioned-file" >> $testroot/stdout.expected
1015 f259c4c1 2021-09-24 stsp cmp -s $testroot/stdout.expected $testroot/stdout
1017 49c543a6 2022-03-31 naddy if [ $ret -ne 0 ]; then
1018 f259c4c1 2021-09-24 stsp diff -u $testroot/stdout.expected $testroot/stdout
1019 f259c4c1 2021-09-24 stsp test_done "$testroot" "$ret"
1023 f259c4c1 2021-09-24 stsp (cd $testroot/wt && got merge -a > $testroot/stdout)
1025 49c543a6 2022-03-31 naddy if [ $ret -ne 0 ]; then
1026 f259c4c1 2021-09-24 stsp echo "got merge failed unexpectedly" >&2
1027 f259c4c1 2021-09-24 stsp test_done "$testroot" "$ret"
1031 af179be7 2023-04-14 stsp echo "R added-file" > $testroot/stdout.expected
1032 af179be7 2023-04-14 stsp echo "R alpha" >> $testroot/stdout.expected
1033 f259c4c1 2021-09-24 stsp echo "R beta" >> $testroot/stdout.expected
1034 f259c4c1 2021-09-24 stsp echo "R epsilon/new" >> $testroot/stdout.expected
1035 f259c4c1 2021-09-24 stsp echo "R gamma/delta" >> $testroot/stdout.expected
1036 f259c4c1 2021-09-24 stsp echo "R symlink" >> $testroot/stdout.expected
1037 af179be7 2023-04-14 stsp echo "G added-file" >> $testroot/stdout.expected
1038 f259c4c1 2021-09-24 stsp echo "Merge of refs/heads/newbranch aborted" \
1039 f259c4c1 2021-09-24 stsp >> $testroot/stdout.expected
1041 f259c4c1 2021-09-24 stsp cmp -s $testroot/stdout.expected $testroot/stdout
1043 49c543a6 2022-03-31 naddy if [ $ret -ne 0 ]; then
1044 f259c4c1 2021-09-24 stsp diff -u $testroot/stdout.expected $testroot/stdout
1045 f259c4c1 2021-09-24 stsp test_done "$testroot" "$ret"
1049 f259c4c1 2021-09-24 stsp echo "delta" > $testroot/content.expected
1050 f259c4c1 2021-09-24 stsp cat $testroot/wt/gamma/delta > $testroot/content
1051 f259c4c1 2021-09-24 stsp cmp -s $testroot/content.expected $testroot/content
1053 49c543a6 2022-03-31 naddy if [ $ret -ne 0 ]; then
1054 f259c4c1 2021-09-24 stsp diff -u $testroot/content.expected $testroot/content
1055 f259c4c1 2021-09-24 stsp test_done "$testroot" "$ret"
1059 f259c4c1 2021-09-24 stsp echo "modified alpha on master" > $testroot/content.expected
1060 f259c4c1 2021-09-24 stsp cat $testroot/wt/alpha > $testroot/content
1061 f259c4c1 2021-09-24 stsp cmp -s $testroot/content.expected $testroot/content
1063 49c543a6 2022-03-31 naddy if [ $ret -ne 0 ]; then
1064 f259c4c1 2021-09-24 stsp diff -u $testroot/content.expected $testroot/content
1065 f259c4c1 2021-09-24 stsp test_done "$testroot" "$ret"
1069 f259c4c1 2021-09-24 stsp echo "beta" > $testroot/content.expected
1070 f259c4c1 2021-09-24 stsp cat $testroot/wt/beta > $testroot/content
1071 f259c4c1 2021-09-24 stsp cmp -s $testroot/content.expected $testroot/content
1073 49c543a6 2022-03-31 naddy if [ $ret -ne 0 ]; then
1074 f259c4c1 2021-09-24 stsp diff -u $testroot/content.expected $testroot/content
1075 f259c4c1 2021-09-24 stsp test_done "$testroot" "$ret"
1079 f259c4c1 2021-09-24 stsp if [ -e $testroot/wt/epsilon/new ]; then
1080 f259c4c1 2021-09-24 stsp echo "reverted file epsilon/new still exists on disk" >&2
1081 f259c4c1 2021-09-24 stsp test_done "$testroot" "1"
1085 f259c4c1 2021-09-24 stsp if [ -e $testroot/wt/symlink ]; then
1086 f259c4c1 2021-09-24 stsp echo "reverted symlink still exists on disk" >&2
1087 f259c4c1 2021-09-24 stsp test_done "$testroot" "1"
1091 f259c4c1 2021-09-24 stsp (cd $testroot/wt && got status > $testroot/stdout)
1093 af179be7 2023-04-14 stsp echo "? added-file" > $testroot/stdout.expected
1094 af179be7 2023-04-14 stsp echo "? unversioned-file" >> $testroot/stdout.expected
1095 f259c4c1 2021-09-24 stsp cmp -s $testroot/stdout.expected $testroot/stdout
1097 49c543a6 2022-03-31 naddy if [ $ret -ne 0 ]; then
1098 f259c4c1 2021-09-24 stsp diff -u $testroot/stdout.expected $testroot/stdout
1099 f259c4c1 2021-09-24 stsp test_done "$testroot" "$ret"
1103 f259c4c1 2021-09-24 stsp (cd $testroot/wt && got log -l3 | grep ^commit > $testroot/stdout)
1104 f259c4c1 2021-09-24 stsp echo "commit $master_commit (master)" > $testroot/stdout.expected
1105 f259c4c1 2021-09-24 stsp echo "commit $commit0" >> $testroot/stdout.expected
1106 f259c4c1 2021-09-24 stsp cmp -s $testroot/stdout.expected $testroot/stdout
1108 49c543a6 2022-03-31 naddy if [ $ret -ne 0 ]; then
1109 f259c4c1 2021-09-24 stsp diff -u $testroot/stdout.expected $testroot/stdout
1110 f259c4c1 2021-09-24 stsp test_done "$testroot" "$ret"
1114 f259c4c1 2021-09-24 stsp (cd $testroot/wt && got update > $testroot/stdout)
1116 f259c4c1 2021-09-24 stsp echo 'Already up-to-date' > $testroot/stdout.expected
1117 f259c4c1 2021-09-24 stsp cmp -s $testroot/stdout.expected $testroot/stdout
1119 49c543a6 2022-03-31 naddy if [ $ret -ne 0 ]; then
1120 f259c4c1 2021-09-24 stsp diff -u $testroot/stdout.expected $testroot/stdout
1122 f259c4c1 2021-09-24 stsp test_done "$testroot" "$ret"
1125 f259c4c1 2021-09-24 stsp test_merge_in_progress() {
1126 f259c4c1 2021-09-24 stsp local testroot=`test_init merge_in_progress`
1127 f259c4c1 2021-09-24 stsp local commit0=`git_show_head $testroot/repo`
1128 f259c4c1 2021-09-24 stsp local commit0_author_time=`git_show_author_time $testroot/repo`
1130 f73bf5bd 2023-10-01 naddy git -C $testroot/repo checkout -q -b newbranch
1131 f259c4c1 2021-09-24 stsp echo "modified alpha on branch" > $testroot/repo/alpha
1132 f259c4c1 2021-09-24 stsp git_commit $testroot/repo -m "committing to alpha on newbranch"
1133 f259c4c1 2021-09-24 stsp local branch_commit0=`git_show_branch_head $testroot/repo newbranch`
1135 f259c4c1 2021-09-24 stsp got checkout -b master $testroot/repo $testroot/wt > /dev/null
1137 49c543a6 2022-03-31 naddy if [ $ret -ne 0 ]; then
1138 f259c4c1 2021-09-24 stsp echo "got checkout failed unexpectedly" >&2
1139 f259c4c1 2021-09-24 stsp test_done "$testroot" "$ret"
1143 f259c4c1 2021-09-24 stsp # create a conflicting commit
1144 f73bf5bd 2023-10-01 naddy git -C $testroot/repo checkout -q master
1145 f259c4c1 2021-09-24 stsp echo "modified alpha on master" > $testroot/repo/alpha
1146 f259c4c1 2021-09-24 stsp git_commit $testroot/repo -m "committing to alpha on master"
1147 f259c4c1 2021-09-24 stsp local master_commit=`git_show_head $testroot/repo`
1149 5e91dae4 2022-08-30 stsp # need an up-to-date work tree for 'got merge'
1150 f259c4c1 2021-09-24 stsp (cd $testroot/wt && got update > /dev/null)
1152 49c543a6 2022-03-31 naddy if [ $ret -ne 0 ]; then
1153 f259c4c1 2021-09-24 stsp echo "got update failed unexpectedly" >&2
1154 f259c4c1 2021-09-24 stsp test_done "$testroot" "$ret"
1158 f259c4c1 2021-09-24 stsp (cd $testroot/wt && got merge newbranch \
1159 f259c4c1 2021-09-24 stsp > $testroot/stdout 2> $testroot/stderr)
1161 49c543a6 2022-03-31 naddy if [ $ret -eq 0 ]; then
1162 f259c4c1 2021-09-24 stsp echo "got merge succeeded unexpectedly" >&2
1163 f259c4c1 2021-09-24 stsp test_done "$testroot" "1"
1167 f259c4c1 2021-09-24 stsp echo "C alpha" >> $testroot/stdout.expected
1168 f259c4c1 2021-09-24 stsp echo "Files with new merge conflicts: 1" >> $testroot/stdout.expected
1169 f259c4c1 2021-09-24 stsp cmp -s $testroot/stdout.expected $testroot/stdout
1171 49c543a6 2022-03-31 naddy if [ $ret -ne 0 ]; then
1172 f259c4c1 2021-09-24 stsp diff -u $testroot/stdout.expected $testroot/stdout
1173 f259c4c1 2021-09-24 stsp test_done "$testroot" "$ret"
1177 f259c4c1 2021-09-24 stsp echo "got: conflicts must be resolved before merging can continue" \
1178 f259c4c1 2021-09-24 stsp > $testroot/stderr.expected
1179 f259c4c1 2021-09-24 stsp cmp -s $testroot/stderr.expected $testroot/stderr
1181 49c543a6 2022-03-31 naddy if [ $ret -ne 0 ]; then
1182 f259c4c1 2021-09-24 stsp diff -u $testroot/stderr.expected $testroot/stderr
1183 f259c4c1 2021-09-24 stsp test_done "$testroot" "$ret"
1187 f259c4c1 2021-09-24 stsp (cd $testroot/wt && got status > $testroot/stdout)
1189 f259c4c1 2021-09-24 stsp echo "C alpha" > $testroot/stdout.expected
1190 f259c4c1 2021-09-24 stsp cmp -s $testroot/stdout.expected $testroot/stdout
1192 49c543a6 2022-03-31 naddy if [ $ret -ne 0 ]; then
1193 f259c4c1 2021-09-24 stsp diff -u $testroot/stdout.expected $testroot/stdout
1194 f259c4c1 2021-09-24 stsp test_done "$testroot" "$ret"
1198 f259c4c1 2021-09-24 stsp for cmd in update commit histedit "rebase newbranch" \
1199 42761529 2023-06-01 stsp "integrate newbranch" "merge newbranch" "stage alpha"; do
1200 f259c4c1 2021-09-24 stsp (cd $testroot/wt && got $cmd > $testroot/stdout \
1201 f259c4c1 2021-09-24 stsp 2> $testroot/stderr)
1203 42761529 2023-06-01 stsp if [ $ret -eq 0 ]; then
1204 42761529 2023-06-01 stsp echo "got $cmd succeeded unexpectedly" >&2
1205 42761529 2023-06-01 stsp test_done "$testroot" "1"
1209 f259c4c1 2021-09-24 stsp echo -n > $testroot/stdout.expected
1210 f259c4c1 2021-09-24 stsp cmp -s $testroot/stdout.expected $testroot/stdout
1212 49c543a6 2022-03-31 naddy if [ $ret -ne 0 ]; then
1213 f259c4c1 2021-09-24 stsp diff -u $testroot/stdout.expected $testroot/stdout
1214 f259c4c1 2021-09-24 stsp test_done "$testroot" "$ret"
1218 f259c4c1 2021-09-24 stsp echo -n "got: a merge operation is in progress in this " \
1219 f259c4c1 2021-09-24 stsp > $testroot/stderr.expected
1220 f259c4c1 2021-09-24 stsp echo "work tree and must be continued or aborted first" \
1221 f259c4c1 2021-09-24 stsp >> $testroot/stderr.expected
1222 f259c4c1 2021-09-24 stsp cmp -s $testroot/stderr.expected $testroot/stderr
1224 49c543a6 2022-03-31 naddy if [ $ret -ne 0 ]; then
1225 f259c4c1 2021-09-24 stsp diff -u $testroot/stderr.expected $testroot/stderr
1226 f259c4c1 2021-09-24 stsp test_done "$testroot" "$ret"
1231 f259c4c1 2021-09-24 stsp test_done "$testroot" "$ret"
1234 f259c4c1 2021-09-24 stsp test_merge_path_prefix() {
1235 f259c4c1 2021-09-24 stsp local testroot=`test_init merge_path_prefix`
1236 f259c4c1 2021-09-24 stsp local commit0=`git_show_head $testroot/repo`
1237 f259c4c1 2021-09-24 stsp local commit0_author_time=`git_show_author_time $testroot/repo`
1239 f73bf5bd 2023-10-01 naddy git -C $testroot/repo checkout -q -b newbranch
1240 f259c4c1 2021-09-24 stsp echo "modified alpha on branch" > $testroot/repo/alpha
1241 f259c4c1 2021-09-24 stsp git_commit $testroot/repo -m "committing to alpha on newbranch"
1242 f259c4c1 2021-09-24 stsp local branch_commit0=`git_show_branch_head $testroot/repo newbranch`
1244 f259c4c1 2021-09-24 stsp got checkout -p epsilon -b master $testroot/repo $testroot/wt \
1245 f259c4c1 2021-09-24 stsp > /dev/null
1247 49c543a6 2022-03-31 naddy if [ $ret -ne 0 ]; then
1248 f259c4c1 2021-09-24 stsp echo "got checkout failed unexpectedly" >&2
1249 f259c4c1 2021-09-24 stsp test_done "$testroot" "$ret"
1253 f259c4c1 2021-09-24 stsp # create a conflicting commit
1254 f73bf5bd 2023-10-01 naddy git -C $testroot/repo checkout -q master
1255 f259c4c1 2021-09-24 stsp echo "modified alpha on master" > $testroot/repo/alpha
1256 f259c4c1 2021-09-24 stsp git_commit $testroot/repo -m "committing to alpha on master"
1257 f259c4c1 2021-09-24 stsp local master_commit=`git_show_head $testroot/repo`
1259 5e91dae4 2022-08-30 stsp # need an up-to-date work tree for 'got merge'
1260 f259c4c1 2021-09-24 stsp (cd $testroot/wt && got update > /dev/null)
1262 49c543a6 2022-03-31 naddy if [ $ret -ne 0 ]; then
1263 f259c4c1 2021-09-24 stsp echo "got update failed unexpectedly" >&2
1264 f259c4c1 2021-09-24 stsp test_done "$testroot" "$ret"
1268 f259c4c1 2021-09-24 stsp (cd $testroot/wt && got merge newbranch \
1269 f259c4c1 2021-09-24 stsp > $testroot/stdout 2> $testroot/stderr)
1271 49c543a6 2022-03-31 naddy if [ $ret -eq 0 ]; then
1272 f259c4c1 2021-09-24 stsp echo "got merge succeeded unexpectedly" >&2
1273 f259c4c1 2021-09-24 stsp test_done "$testroot" "1"
1277 f259c4c1 2021-09-24 stsp echo -n "got: cannot merge branch which contains changes outside " \
1278 f259c4c1 2021-09-24 stsp > $testroot/stderr.expected
1279 f259c4c1 2021-09-24 stsp echo "of this work tree's path prefix" >> $testroot/stderr.expected
1280 f259c4c1 2021-09-24 stsp cmp -s $testroot/stderr.expected $testroot/stderr
1282 49c543a6 2022-03-31 naddy if [ $ret -ne 0 ]; then
1283 f259c4c1 2021-09-24 stsp diff -u $testroot/stderr.expected $testroot/stderr
1285 f259c4c1 2021-09-24 stsp test_done "$testroot" "$ret"
1288 f259c4c1 2021-09-24 stsp test_merge_missing_file() {
1289 f259c4c1 2021-09-24 stsp local testroot=`test_init merge_missing_file`
1290 f259c4c1 2021-09-24 stsp local commit0=`git_show_head $testroot/repo`
1291 f259c4c1 2021-09-24 stsp local commit0_author_time=`git_show_author_time $testroot/repo`
1293 f73bf5bd 2023-10-01 naddy git -C $testroot/repo checkout -q -b newbranch
1294 f259c4c1 2021-09-24 stsp echo "modified alpha on branch" > $testroot/repo/alpha
1295 f259c4c1 2021-09-24 stsp echo "modified delta on branch" > $testroot/repo/gamma/delta
1296 f259c4c1 2021-09-24 stsp git_commit $testroot/repo -m "committing to alpha and delta"
1297 f259c4c1 2021-09-24 stsp local branch_commit0=`git_show_branch_head $testroot/repo newbranch`
1299 f259c4c1 2021-09-24 stsp got checkout -b master $testroot/repo $testroot/wt > /dev/null
1301 49c543a6 2022-03-31 naddy if [ $ret -ne 0 ]; then
1302 f259c4c1 2021-09-24 stsp echo "got checkout failed unexpectedly" >&2
1303 f259c4c1 2021-09-24 stsp test_done "$testroot" "$ret"
1307 f259c4c1 2021-09-24 stsp # create a conflicting commit which renames alpha
1308 f73bf5bd 2023-10-01 naddy git -C $testroot/repo checkout -q master
1309 f73bf5bd 2023-10-01 naddy git -C $testroot/repo mv alpha epsilon/alpha-moved
1310 f259c4c1 2021-09-24 stsp git_commit $testroot/repo -m "moving alpha on master"
1311 f259c4c1 2021-09-24 stsp local master_commit=`git_show_head $testroot/repo`
1313 5e91dae4 2022-08-30 stsp # need an up-to-date work tree for 'got merge'
1314 f259c4c1 2021-09-24 stsp (cd $testroot/wt && got update > /dev/null)
1316 49c543a6 2022-03-31 naddy if [ $ret -ne 0 ]; then
1317 f259c4c1 2021-09-24 stsp echo "got update failed unexpectedly" >&2
1318 f259c4c1 2021-09-24 stsp test_done "$testroot" "$ret"
1322 f259c4c1 2021-09-24 stsp (cd $testroot/wt && got merge newbranch \
1323 f259c4c1 2021-09-24 stsp > $testroot/stdout 2> $testroot/stderr)
1325 49c543a6 2022-03-31 naddy if [ $ret -eq 0 ]; then
1326 f259c4c1 2021-09-24 stsp echo "got merge succeeded unexpectedly" >&2
1327 f259c4c1 2021-09-24 stsp test_done "$testroot" "1"
1331 f259c4c1 2021-09-24 stsp echo "! alpha" > $testroot/stdout.expected
1332 f259c4c1 2021-09-24 stsp echo "G gamma/delta" >> $testroot/stdout.expected
1333 35ca1db7 2021-09-28 stsp echo -n "Files which had incoming changes but could not be found " \
1334 35ca1db7 2021-09-28 stsp >> $testroot/stdout.expected
1335 35ca1db7 2021-09-28 stsp echo "in the work tree: 1" >> $testroot/stdout.expected
1336 f259c4c1 2021-09-24 stsp cmp -s $testroot/stdout.expected $testroot/stdout
1338 49c543a6 2022-03-31 naddy if [ $ret -ne 0 ]; then
1339 f259c4c1 2021-09-24 stsp diff -u $testroot/stdout.expected $testroot/stdout
1340 f259c4c1 2021-09-24 stsp test_done "$testroot" "$ret"
1344 c1b05723 2021-09-28 stsp echo -n "got: changes destined for some files " \
1345 f259c4c1 2021-09-24 stsp > $testroot/stderr.expected
1346 f259c4c1 2021-09-24 stsp echo -n "were not yet merged and should be merged manually if " \
1347 f259c4c1 2021-09-24 stsp >> $testroot/stderr.expected
1348 f259c4c1 2021-09-24 stsp echo "required before the merge operation is continued" \
1349 f259c4c1 2021-09-24 stsp >> $testroot/stderr.expected
1350 f259c4c1 2021-09-24 stsp cmp -s $testroot/stderr.expected $testroot/stderr
1352 49c543a6 2022-03-31 naddy if [ $ret -ne 0 ]; then
1353 f259c4c1 2021-09-24 stsp diff -u $testroot/stderr.expected $testroot/stderr
1354 f259c4c1 2021-09-24 stsp test_done "$testroot" "$ret"
1358 f259c4c1 2021-09-24 stsp (cd $testroot/wt && got status > $testroot/stdout)
1360 f259c4c1 2021-09-24 stsp echo "M gamma/delta" > $testroot/stdout.expected
1361 a6a8f8bb 2021-09-24 stsp cmp -s $testroot/stdout.expected $testroot/stdout
1363 49c543a6 2022-03-31 naddy if [ $ret -ne 0 ]; then
1364 a6a8f8bb 2021-09-24 stsp diff -u $testroot/stdout.expected $testroot/stdout
1365 a6a8f8bb 2021-09-24 stsp test_done "$testroot" "$ret"
1369 a6a8f8bb 2021-09-24 stsp test_done "$testroot" "$ret"
1372 a6a8f8bb 2021-09-24 stsp test_merge_no_op() {
1373 a6a8f8bb 2021-09-24 stsp local testroot=`test_init merge_no_op`
1374 a6a8f8bb 2021-09-24 stsp local commit0=`git_show_head $testroot/repo`
1375 a6a8f8bb 2021-09-24 stsp local commit0_author_time=`git_show_author_time $testroot/repo`
1377 f73bf5bd 2023-10-01 naddy git -C $testroot/repo checkout -q -b newbranch
1378 a6a8f8bb 2021-09-24 stsp echo "modified alpha on branch" > $testroot/repo/alpha
1379 a6a8f8bb 2021-09-24 stsp git_commit $testroot/repo -m "committing to alpha on newbranch"
1380 35d2583f 2023-04-17 stsp local branch_commit=`git_show_branch_head $testroot/repo newbranch`
1382 a6a8f8bb 2021-09-24 stsp got checkout -b master $testroot/repo $testroot/wt > /dev/null
1384 49c543a6 2022-03-31 naddy if [ $ret -ne 0 ]; then
1385 a6a8f8bb 2021-09-24 stsp echo "got checkout failed unexpectedly" >&2
1386 a6a8f8bb 2021-09-24 stsp test_done "$testroot" "$ret"
1390 a6a8f8bb 2021-09-24 stsp # create a conflicting commit
1391 f73bf5bd 2023-10-01 naddy git -C $testroot/repo checkout -q master
1392 a6a8f8bb 2021-09-24 stsp echo "modified alpha on master" > $testroot/repo/alpha
1393 a6a8f8bb 2021-09-24 stsp git_commit $testroot/repo -m "committing to alpha on master"
1394 a6a8f8bb 2021-09-24 stsp local master_commit=`git_show_head $testroot/repo`
1396 5e91dae4 2022-08-30 stsp # need an up-to-date work tree for 'got merge'
1397 a6a8f8bb 2021-09-24 stsp (cd $testroot/wt && got update > /dev/null)
1399 49c543a6 2022-03-31 naddy if [ $ret -ne 0 ]; then
1400 a6a8f8bb 2021-09-24 stsp echo "got update failed unexpectedly" >&2
1401 a6a8f8bb 2021-09-24 stsp test_done "$testroot" "$ret"
1405 a6a8f8bb 2021-09-24 stsp (cd $testroot/wt && got merge newbranch \
1406 a6a8f8bb 2021-09-24 stsp > $testroot/stdout 2> $testroot/stderr)
1408 49c543a6 2022-03-31 naddy if [ $ret -eq 0 ]; then
1409 a6a8f8bb 2021-09-24 stsp echo "got merge succeeded unexpectedly" >&2
1410 a6a8f8bb 2021-09-24 stsp test_done "$testroot" "1"
1414 a6a8f8bb 2021-09-24 stsp echo "C alpha" >> $testroot/stdout.expected
1415 a6a8f8bb 2021-09-24 stsp echo "Files with new merge conflicts: 1" >> $testroot/stdout.expected
1416 a6a8f8bb 2021-09-24 stsp cmp -s $testroot/stdout.expected $testroot/stdout
1418 49c543a6 2022-03-31 naddy if [ $ret -ne 0 ]; then
1419 a6a8f8bb 2021-09-24 stsp diff -u $testroot/stdout.expected $testroot/stdout
1420 a6a8f8bb 2021-09-24 stsp test_done "$testroot" "$ret"
1424 a6a8f8bb 2021-09-24 stsp echo "got: conflicts must be resolved before merging can continue" \
1425 a6a8f8bb 2021-09-24 stsp > $testroot/stderr.expected
1426 a6a8f8bb 2021-09-24 stsp cmp -s $testroot/stderr.expected $testroot/stderr
1428 49c543a6 2022-03-31 naddy if [ $ret -ne 0 ]; then
1429 a6a8f8bb 2021-09-24 stsp diff -u $testroot/stderr.expected $testroot/stderr
1430 a6a8f8bb 2021-09-24 stsp test_done "$testroot" "$ret"
1434 a6a8f8bb 2021-09-24 stsp (cd $testroot/wt && got status > $testroot/stdout)
1436 a6a8f8bb 2021-09-24 stsp echo "C alpha" > $testroot/stdout.expected
1437 f259c4c1 2021-09-24 stsp cmp -s $testroot/stdout.expected $testroot/stdout
1439 49c543a6 2022-03-31 naddy if [ $ret -ne 0 ]; then
1440 f259c4c1 2021-09-24 stsp diff -u $testroot/stdout.expected $testroot/stdout
1441 f259c4c1 2021-09-24 stsp test_done "$testroot" "$ret"
1445 a6a8f8bb 2021-09-24 stsp # resolve the conflict by reverting all changes; now it is no-op merge
1446 a6a8f8bb 2021-09-24 stsp (cd $testroot/wt && got revert alpha > /dev/null)
1448 49c543a6 2022-03-31 naddy if [ $ret -ne 0 ]; then
1449 a6a8f8bb 2021-09-24 stsp echo "got revert failed unexpectedly" >&2
1450 a6a8f8bb 2021-09-24 stsp test_done "$testroot" "$ret"
1454 a6a8f8bb 2021-09-24 stsp (cd $testroot/wt && got merge -c > $testroot/stdout \
1455 a6a8f8bb 2021-09-24 stsp 2> $testroot/stderr)
1457 35d2583f 2023-04-17 stsp if [ $ret -ne 0 ]; then
1458 35d2583f 2023-04-17 stsp echo "got merge failed unexpectedly" >&2
1459 a6a8f8bb 2021-09-24 stsp test_done "$testroot" "$ret"
1463 35d2583f 2023-04-17 stsp echo -n '' > $testroot/stderr.expected
1464 a6a8f8bb 2021-09-24 stsp cmp -s $testroot/stderr.expected $testroot/stderr
1466 49c543a6 2022-03-31 naddy if [ $ret -ne 0 ]; then
1467 a6a8f8bb 2021-09-24 stsp diff -u $testroot/stderr.expected $testroot/stderr
1468 35d2583f 2023-04-17 stsp test_done "$testroot" "$ret"
1472 35d2583f 2023-04-17 stsp local merge_commit=`git_show_head $testroot/repo`
1473 35d2583f 2023-04-17 stsp echo -n "Merged refs/heads/newbranch into refs/heads/master: " \
1474 35d2583f 2023-04-17 stsp > $testroot/stdout.expected
1475 35d2583f 2023-04-17 stsp echo $merge_commit >> $testroot/stdout.expected
1477 35d2583f 2023-04-17 stsp cmp -s $testroot/stdout.expected $testroot/stdout
1479 35d2583f 2023-04-17 stsp if [ $ret -ne 0 ]; then
1480 35d2583f 2023-04-17 stsp diff -u $testroot/stdout.expected $testroot/stdout
1481 a6a8f8bb 2021-09-24 stsp test_done "$testroot" "$ret"
1485 a6a8f8bb 2021-09-24 stsp (cd $testroot/wt && got status > $testroot/stdout)
1487 a6a8f8bb 2021-09-24 stsp echo -n "" > $testroot/stdout.expected
1488 4e91ef15 2021-09-26 stsp cmp -s $testroot/stdout.expected $testroot/stdout
1490 49c543a6 2022-03-31 naddy if [ $ret -ne 0 ]; then
1491 4e91ef15 2021-09-26 stsp diff -u $testroot/stdout.expected $testroot/stdout
1492 35d2583f 2023-04-17 stsp test_done "$testroot" "$ret"
1496 35d2583f 2023-04-17 stsp # We should have created a merge commit with two parents.
1497 35d2583f 2023-04-17 stsp got log -r $testroot/repo -l1 -c $merge_commit | grep ^parent \
1498 35d2583f 2023-04-17 stsp > $testroot/stdout
1499 35d2583f 2023-04-17 stsp echo "parent 1: $master_commit" > $testroot/stdout.expected
1500 35d2583f 2023-04-17 stsp echo "parent 2: $branch_commit" >> $testroot/stdout.expected
1501 35d2583f 2023-04-17 stsp cmp -s $testroot/stdout.expected $testroot/stdout
1503 35d2583f 2023-04-17 stsp if [ $ret -ne 0 ]; then
1504 35d2583f 2023-04-17 stsp diff -u $testroot/stdout.expected $testroot/stdout
1506 4e91ef15 2021-09-26 stsp test_done "$testroot" "$ret"
1509 4e91ef15 2021-09-26 stsp test_merge_imported_branch() {
1510 4e91ef15 2021-09-26 stsp local testroot=`test_init merge_import`
1511 4e91ef15 2021-09-26 stsp local commit0=`git_show_head $testroot/repo`
1512 4e91ef15 2021-09-26 stsp local commit0_author_time=`git_show_author_time $testroot/repo`
1514 4e91ef15 2021-09-26 stsp # import a new sub-tree to the 'files' branch such that
1515 4e91ef15 2021-09-26 stsp # none of the files added here collide with existing ones
1516 4e91ef15 2021-09-26 stsp mkdir -p $testroot/tree/there
1517 4e91ef15 2021-09-26 stsp mkdir -p $testroot/tree/be/lots
1518 4e91ef15 2021-09-26 stsp mkdir -p $testroot/tree/files
1519 4e91ef15 2021-09-26 stsp echo "there should" > $testroot/tree/there/should
1520 4e91ef15 2021-09-26 stsp echo "be lots of" > $testroot/tree/be/lots/of
1521 4e91ef15 2021-09-26 stsp echo "files here" > $testroot/tree/files/here
1522 4e91ef15 2021-09-26 stsp got import -r $testroot/repo -b files -m 'import files' \
1523 4e91ef15 2021-09-26 stsp $testroot/tree > /dev/null
1525 4e91ef15 2021-09-26 stsp got checkout -b master $testroot/repo $testroot/wt > /dev/null
1527 49c543a6 2022-03-31 naddy if [ $ret -ne 0 ]; then
1528 4e91ef15 2021-09-26 stsp echo "got checkout failed unexpectedly" >&2
1529 4e91ef15 2021-09-26 stsp test_done "$testroot" "$ret"
1533 4e91ef15 2021-09-26 stsp (cd $testroot/wt && got merge files > $testroot/stdout)
1535 49c543a6 2022-03-31 naddy if [ $ret -ne 0 ]; then
1536 4e91ef15 2021-09-26 stsp echo "got merge failed unexpectedly" >&2
1537 4e91ef15 2021-09-26 stsp test_done "$testroot" "$ret"
1541 4e91ef15 2021-09-26 stsp local merge_commit0=`git_show_head $testroot/repo`
1542 4e91ef15 2021-09-26 stsp cat > $testroot/stdout.expected <<EOF
1543 4e91ef15 2021-09-26 stsp A be/lots/of
1544 4e91ef15 2021-09-26 stsp A files/here
1545 4e91ef15 2021-09-26 stsp A there/should
1546 4e91ef15 2021-09-26 stsp Merged refs/heads/files into refs/heads/master: $merge_commit0
1548 4e91ef15 2021-09-26 stsp cmp -s $testroot/stdout.expected $testroot/stdout
1550 49c543a6 2022-03-31 naddy if [ $ret -ne 0 ]; then
1551 4e91ef15 2021-09-26 stsp diff -u $testroot/stdout.expected $testroot/stdout
1552 4e91ef15 2021-09-26 stsp test_done "$testroot" "$ret"
1556 4e91ef15 2021-09-26 stsp # try to merge again while no new changes are available
1557 4e91ef15 2021-09-26 stsp (cd $testroot/wt && got merge files > $testroot/stdout)
1559 49c543a6 2022-03-31 naddy if [ $ret -ne 0 ]; then
1560 4e91ef15 2021-09-26 stsp echo "got merge failed unexpectedly" >&2
1561 4e91ef15 2021-09-26 stsp test_done "$testroot" "$ret"
1564 4e91ef15 2021-09-26 stsp echo "Already up-to-date" > $testroot/stdout.expected
1565 a6a8f8bb 2021-09-24 stsp cmp -s $testroot/stdout.expected $testroot/stdout
1567 49c543a6 2022-03-31 naddy if [ $ret -ne 0 ]; then
1568 a6a8f8bb 2021-09-24 stsp diff -u $testroot/stdout.expected $testroot/stdout
1569 4e91ef15 2021-09-26 stsp test_done "$testroot" "$ret"
1573 4e91ef15 2021-09-26 stsp # update the 'files' branch
1574 f73bf5bd 2023-10-01 naddy git -C $testroot/repo reset -q --hard master
1575 f73bf5bd 2023-10-01 naddy git -C $testroot/repo checkout -q files
1576 4e91ef15 2021-09-26 stsp echo "indeed" > $testroot/repo/indeed
1577 f73bf5bd 2023-10-01 naddy git -C $testroot/repo add indeed
1578 4e91ef15 2021-09-26 stsp git_commit $testroot/repo -m "adding another file indeed"
1579 4e91ef15 2021-09-26 stsp echo "be lots and lots of" > $testroot/repo/be/lots/of
1580 4e91ef15 2021-09-26 stsp git_commit $testroot/repo -m "lots of changes"
1582 4e91ef15 2021-09-26 stsp (cd $testroot/wt && got update > /dev/null)
1584 49c543a6 2022-03-31 naddy if [ $ret -ne 0 ]; then
1585 4e91ef15 2021-09-26 stsp echo "got update failed unexpectedly" >&2
1586 4e91ef15 2021-09-26 stsp test_done "$testroot" "$ret"
1590 4e91ef15 2021-09-26 stsp # we should now be able to merge more changes from files branch
1591 4e91ef15 2021-09-26 stsp (cd $testroot/wt && got merge files > $testroot/stdout)
1593 49c543a6 2022-03-31 naddy if [ $ret -ne 0 ]; then
1594 4e91ef15 2021-09-26 stsp echo "got merge failed unexpectedly" >&2
1595 4e91ef15 2021-09-26 stsp test_done "$testroot" "$ret"
1599 4e91ef15 2021-09-26 stsp local merge_commit1=`git_show_branch_head $testroot/repo master`
1600 4e91ef15 2021-09-26 stsp cat > $testroot/stdout.expected <<EOF
1601 4e91ef15 2021-09-26 stsp G be/lots/of
1603 4e91ef15 2021-09-26 stsp Merged refs/heads/files into refs/heads/master: $merge_commit1
1606 4e91ef15 2021-09-26 stsp cmp -s $testroot/stdout.expected $testroot/stdout
1608 49c543a6 2022-03-31 naddy if [ $ret -ne 0 ]; then
1609 4e91ef15 2021-09-26 stsp diff -u $testroot/stdout.expected $testroot/stdout
1611 f259c4c1 2021-09-24 stsp test_done "$testroot" "$ret"
1614 088449d3 2021-09-26 stsp test_merge_interrupt() {
1615 088449d3 2021-09-26 stsp local testroot=`test_init merge_interrupt`
1616 088449d3 2021-09-26 stsp local commit0=`git_show_head $testroot/repo`
1617 088449d3 2021-09-26 stsp local commit0_author_time=`git_show_author_time $testroot/repo`
1619 f73bf5bd 2023-10-01 naddy git -C $testroot/repo checkout -q -b newbranch
1620 088449d3 2021-09-26 stsp echo "modified alpha on branch" > $testroot/repo/alpha
1621 088449d3 2021-09-26 stsp git_commit $testroot/repo -m "committing to alpha on newbranch"
1622 088449d3 2021-09-26 stsp local branch_commit0=`git_show_branch_head $testroot/repo newbranch`
1624 088449d3 2021-09-26 stsp got checkout -b master $testroot/repo $testroot/wt > /dev/null
1626 49c543a6 2022-03-31 naddy if [ $ret -ne 0 ]; then
1627 088449d3 2021-09-26 stsp echo "got checkout failed unexpectedly" >&2
1628 088449d3 2021-09-26 stsp test_done "$testroot" "$ret"
1632 088449d3 2021-09-26 stsp # create a non-conflicting commit
1633 f73bf5bd 2023-10-01 naddy git -C $testroot/repo checkout -q master
1634 088449d3 2021-09-26 stsp echo "modified beta on master" > $testroot/repo/beta
1635 088449d3 2021-09-26 stsp git_commit $testroot/repo -m "committing to beta on master"
1636 088449d3 2021-09-26 stsp local master_commit=`git_show_head $testroot/repo`
1638 5e91dae4 2022-08-30 stsp # need an up-to-date work tree for 'got merge'
1639 088449d3 2021-09-26 stsp (cd $testroot/wt && got update > /dev/null)
1641 49c543a6 2022-03-31 naddy if [ $ret -ne 0 ]; then
1642 088449d3 2021-09-26 stsp echo "got update failed unexpectedly" >&2
1643 088449d3 2021-09-26 stsp test_done "$testroot" "$ret"
1647 088449d3 2021-09-26 stsp (cd $testroot/wt && got merge -n newbranch \
1648 088449d3 2021-09-26 stsp > $testroot/stdout 2> $testroot/stderr)
1650 49c543a6 2022-03-31 naddy if [ $ret -ne 0 ]; then
1651 088449d3 2021-09-26 stsp echo "got merge failed unexpectedly" >&2
1652 088449d3 2021-09-26 stsp test_done "$testroot" "1"
1656 088449d3 2021-09-26 stsp echo "G alpha" > $testroot/stdout.expected
1657 088449d3 2021-09-26 stsp echo "Merge of refs/heads/newbranch interrupted on request" \
1658 088449d3 2021-09-26 stsp >> $testroot/stdout.expected
1659 088449d3 2021-09-26 stsp cmp -s $testroot/stdout.expected $testroot/stdout
1661 49c543a6 2022-03-31 naddy if [ $ret -ne 0 ]; then
1662 088449d3 2021-09-26 stsp diff -u $testroot/stdout.expected $testroot/stdout
1663 088449d3 2021-09-26 stsp test_done "$testroot" "$ret"
1667 088449d3 2021-09-26 stsp (cd $testroot/wt && got status > $testroot/stdout)
1669 088449d3 2021-09-26 stsp echo "M alpha" > $testroot/stdout.expected
1670 088449d3 2021-09-26 stsp cmp -s $testroot/stdout.expected $testroot/stdout
1672 49c543a6 2022-03-31 naddy if [ $ret -ne 0 ]; then
1673 088449d3 2021-09-26 stsp diff -u $testroot/stdout.expected $testroot/stdout
1674 088449d3 2021-09-26 stsp test_done "$testroot" "$ret"
1678 088449d3 2021-09-26 stsp echo "modified alpha on branch" > $testroot/content.expected
1679 088449d3 2021-09-26 stsp cat $testroot/wt/alpha > $testroot/content
1680 088449d3 2021-09-26 stsp cmp -s $testroot/content.expected $testroot/content
1682 49c543a6 2022-03-31 naddy if [ $ret -ne 0 ]; then
1683 088449d3 2021-09-26 stsp diff -u $testroot/content.expected $testroot/content
1684 088449d3 2021-09-26 stsp test_done "$testroot" "$ret"
1688 088449d3 2021-09-26 stsp # adjust merge result
1689 088449d3 2021-09-26 stsp echo "adjusted merge result" > $testroot/wt/alpha
1691 088449d3 2021-09-26 stsp # continue the merge
1692 088449d3 2021-09-26 stsp (cd $testroot/wt && got merge -c > $testroot/stdout)
1694 49c543a6 2022-03-31 naddy if [ $ret -ne 0 ]; then
1695 088449d3 2021-09-26 stsp echo "got merge failed unexpectedly" >&2
1696 088449d3 2021-09-26 stsp test_done "$testroot" "$ret"
1700 088449d3 2021-09-26 stsp local merge_commit=`git_show_head $testroot/repo`
1702 0ff8d236 2021-09-28 stsp echo "M alpha" > $testroot/stdout.expected
1703 088449d3 2021-09-26 stsp echo -n "Merged refs/heads/newbranch into refs/heads/master: " \
1704 0ff8d236 2021-09-28 stsp >> $testroot/stdout.expected
1705 088449d3 2021-09-26 stsp echo $merge_commit >> $testroot/stdout.expected
1707 088449d3 2021-09-26 stsp cmp -s $testroot/stdout.expected $testroot/stdout
1709 49c543a6 2022-03-31 naddy if [ $ret -ne 0 ]; then
1710 088449d3 2021-09-26 stsp diff -u $testroot/stdout.expected $testroot/stdout
1711 088449d3 2021-09-26 stsp test_done "$testroot" "$ret"
1715 088449d3 2021-09-26 stsp (cd $testroot/wt && got status > $testroot/stdout)
1717 088449d3 2021-09-26 stsp echo -n > $testroot/stdout.expected
1718 088449d3 2021-09-26 stsp cmp -s $testroot/stdout.expected $testroot/stdout
1720 49c543a6 2022-03-31 naddy if [ $ret -ne 0 ]; then
1721 088449d3 2021-09-26 stsp diff -u $testroot/stdout.expected $testroot/stdout
1722 088449d3 2021-09-26 stsp test_done "$testroot" "$ret"
1726 088449d3 2021-09-26 stsp (cd $testroot/wt && got log -l3 | grep ^commit > $testroot/stdout)
1727 088449d3 2021-09-26 stsp echo "commit $merge_commit (master)" > $testroot/stdout.expected
1728 088449d3 2021-09-26 stsp echo "commit $master_commit" >> $testroot/stdout.expected
1729 088449d3 2021-09-26 stsp echo "commit $commit0" >> $testroot/stdout.expected
1730 088449d3 2021-09-26 stsp cmp -s $testroot/stdout.expected $testroot/stdout
1732 49c543a6 2022-03-31 naddy if [ $ret -ne 0 ]; then
1733 088449d3 2021-09-26 stsp diff -u $testroot/stdout.expected $testroot/stdout
1734 088449d3 2021-09-26 stsp test_done "$testroot" "$ret"
1738 088449d3 2021-09-26 stsp (cd $testroot/wt && got update > $testroot/stdout)
1740 088449d3 2021-09-26 stsp echo 'Already up-to-date' > $testroot/stdout.expected
1741 088449d3 2021-09-26 stsp cmp -s $testroot/stdout.expected $testroot/stdout
1743 49c543a6 2022-03-31 naddy if [ $ret -ne 0 ]; then
1744 088449d3 2021-09-26 stsp diff -u $testroot/stdout.expected $testroot/stdout
1745 088449d3 2021-09-26 stsp test_done "$testroot" "$ret"
1749 088449d3 2021-09-26 stsp # We should have created a merge commit with two parents.
1750 088449d3 2021-09-26 stsp (cd $testroot/wt && got log -l1 | grep ^parent > $testroot/stdout)
1751 088449d3 2021-09-26 stsp echo "parent 1: $master_commit" > $testroot/stdout.expected
1752 088449d3 2021-09-26 stsp echo "parent 2: $branch_commit0" >> $testroot/stdout.expected
1753 088449d3 2021-09-26 stsp cmp -s $testroot/stdout.expected $testroot/stdout
1755 49c543a6 2022-03-31 naddy if [ $ret -ne 0 ]; then
1756 088449d3 2021-09-26 stsp diff -u $testroot/stdout.expected $testroot/stdout
1758 088449d3 2021-09-26 stsp test_done "$testroot" "$ret"
1761 b2b3fce1 2022-10-29 op test_merge_umask() {
1762 b2b3fce1 2022-10-29 op local testroot=`test_init merge_umask`
1764 f73bf5bd 2023-10-01 naddy git -C $testroot/repo checkout -q -b newbranch
1765 b2b3fce1 2022-10-29 op echo "modified alpha on branch" >$testroot/repo/alpha
1766 b2b3fce1 2022-10-29 op git_commit "$testroot/repo" -m "committing alpha on newbranch"
1767 b2b3fce1 2022-10-29 op echo "modified delta on branch" >$testroot/repo/gamma/delta
1768 b2b3fce1 2022-10-29 op git_commit "$testroot/repo" -m "committing delta on newbranch"
1770 b2b3fce1 2022-10-29 op # diverge from newbranch
1771 f73bf5bd 2023-10-01 naddy git -C "$testroot/repo" checkout -q master
1772 b2b3fce1 2022-10-29 op echo "modified beta on master" >$testroot/repo/beta
1773 b2b3fce1 2022-10-29 op git_commit "$testroot/repo" -m "committing zeto no master"
1775 b2b3fce1 2022-10-29 op got checkout "$testroot/repo" "$testroot/wt" >/dev/null
1777 b2b3fce1 2022-10-29 op # using a subshell to avoid clobbering global umask
1778 b2b3fce1 2022-10-29 op (umask 077 && cd "$testroot/wt" && got merge newbranch) >/dev/null
1780 b2b3fce1 2022-10-29 op for f in alpha gamma/delta; do
1781 b2b3fce1 2022-10-29 op ls -l "$testroot/wt/$f" | grep -q ^-rw-------
1782 b2b3fce1 2022-10-29 op if [ $? -ne 0 ]; then
1783 b2b3fce1 2022-10-29 op echo "$f is not 0600 after merge" >&2
1784 b2b3fce1 2022-10-29 op ls -l "$testroot/wt/$f" >&2
1785 b2b3fce1 2022-10-29 op test_done "$testroot" 1
1789 b2b3fce1 2022-10-29 op test_done "$testroot" 0
1792 d51d11be 2023-02-21 op test_merge_gitconfig_author() {
1793 d51d11be 2023-02-21 op local testroot=`test_init merge_gitconfig_author`
1795 f73bf5bd 2023-10-01 naddy git -C $testroot/repo config user.name 'Flan Luck'
1796 f73bf5bd 2023-10-01 naddy git -C $testroot/repo config user.email 'flan_luck@openbsd.org'
1798 f73bf5bd 2023-10-01 naddy git -C $testroot/repo checkout -q -b newbranch
1799 d51d11be 2023-02-21 op echo "modified alpha on branch" >$testroot/repo/alpha
1800 d51d11be 2023-02-21 op git_commit "$testroot/repo" -m "committing alpha on newbranch"
1801 d51d11be 2023-02-21 op echo "modified delta on branch" >$testroot/repo/gamma/delta
1802 d51d11be 2023-02-21 op git_commit "$testroot/repo" -m "committing delta on newbranch"
1804 d51d11be 2023-02-21 op # diverge from newbranch
1805 f73bf5bd 2023-10-01 naddy git -C "$testroot/repo" checkout -q master
1806 d51d11be 2023-02-21 op echo "modified beta on master" >$testroot/repo/beta
1807 d51d11be 2023-02-21 op git_commit "$testroot/repo" -m "committing zeto no master"
1809 d51d11be 2023-02-21 op got checkout "$testroot/repo" "$testroot/wt" >/dev/null
1811 d51d11be 2023-02-21 op # unset in a subshell to avoid affecting our environment
1812 d51d11be 2023-02-21 op (unset GOT_IGNORE_GITCONFIG && cd $testroot/wt && \
1813 d51d11be 2023-02-21 op got merge newbranch > /dev/null)
1815 d51d11be 2023-02-21 op (cd $testroot/repo && got log -l1 | grep ^from: > $testroot/stdout)
1817 d51d11be 2023-02-21 op if [ $ret -ne 0 ]; then
1818 d51d11be 2023-02-21 op test_done "$testroot" "$ret"
1822 d51d11be 2023-02-21 op echo "from: Flan Luck <flan_luck@openbsd.org>" \
1823 d51d11be 2023-02-21 op > $testroot/stdout.expected
1824 d51d11be 2023-02-21 op cmp -s $testroot/stdout.expected $testroot/stdout
1826 d51d11be 2023-02-21 op if [ $ret -ne 0 ]; then
1827 d51d11be 2023-02-21 op diff -u $testroot/stdout.expected $testroot/stdout
1829 d51d11be 2023-02-21 op test_done "$testroot" "$ret"
1832 13342307 2023-06-21 stsp test_merge_fetched_branch() {
1833 13342307 2023-06-21 stsp local testroot=`test_init merge_fetched_branch`
1834 13342307 2023-06-21 stsp local testurl=ssh://127.0.0.1/$testroot
1835 13342307 2023-06-21 stsp local commit_id=`git_show_head $testroot/repo`
1837 13342307 2023-06-21 stsp got clone -q $testurl/repo $testroot/repo-clone
1839 13342307 2023-06-21 stsp if [ $ret -ne 0 ]; then
1840 13342307 2023-06-21 stsp echo "got clone command failed unexpectedly" >&2
1841 13342307 2023-06-21 stsp test_done "$testroot" "$ret"
1845 13342307 2023-06-21 stsp echo "modified alpha" > $testroot/repo/alpha
1846 13342307 2023-06-21 stsp git_commit $testroot/repo -m "modified alpha"
1847 13342307 2023-06-21 stsp local commit_id2=`git_show_head $testroot/repo`
1849 13342307 2023-06-21 stsp got fetch -q -r $testroot/repo-clone > $testroot/stdout
1851 13342307 2023-06-21 stsp if [ $ret -ne 0 ]; then
1852 13342307 2023-06-21 stsp echo "got fetch command failed unexpectedly" >&2
1853 13342307 2023-06-21 stsp test_done "$testroot" "$ret"
1857 13342307 2023-06-21 stsp echo -n > $testroot/stdout.expected
1859 13342307 2023-06-21 stsp cmp -s $testroot/stdout $testroot/stdout.expected
1861 13342307 2023-06-21 stsp if [ $ret -ne 0 ]; then
1862 13342307 2023-06-21 stsp diff -u $testroot/stdout.expected $testroot/stdout
1863 13342307 2023-06-21 stsp test_done "$testroot" "$ret"
1867 13342307 2023-06-21 stsp got ref -l -r $testroot/repo-clone > $testroot/stdout
1869 13342307 2023-06-21 stsp echo "HEAD: refs/heads/master" > $testroot/stdout.expected
1870 13342307 2023-06-21 stsp echo "refs/heads/master: $commit_id" >> $testroot/stdout.expected
1871 13342307 2023-06-21 stsp echo "refs/remotes/origin/HEAD: refs/remotes/origin/master" \
1872 13342307 2023-06-21 stsp >> $testroot/stdout.expected
1873 13342307 2023-06-21 stsp echo "refs/remotes/origin/master: $commit_id2" \
1874 13342307 2023-06-21 stsp >> $testroot/stdout.expected
1876 13342307 2023-06-21 stsp cmp -s $testroot/stdout $testroot/stdout.expected
1878 13342307 2023-06-21 stsp if [ $ret -ne 0 ]; then
1879 13342307 2023-06-21 stsp diff -u $testroot/stdout.expected $testroot/stdout
1880 13342307 2023-06-21 stsp test_done "$testroot" "$ret"
1884 13342307 2023-06-21 stsp got checkout $testroot/repo-clone $testroot/wt > /dev/null
1886 13342307 2023-06-21 stsp echo "modified beta" > $testroot/wt/beta
1887 13342307 2023-06-21 stsp (cd $testroot/wt && got commit -m "modified beta" > /dev/null)
1888 13342307 2023-06-21 stsp local commit_id3=`git_show_head $testroot/repo-clone`
1890 13342307 2023-06-21 stsp (cd $testroot/wt && got update > /dev/null)
1891 13342307 2023-06-21 stsp (cd $testroot/wt && got merge origin/master > $testroot/stdout)
1892 13342307 2023-06-21 stsp local merge_commit_id=`git_show_head $testroot/repo-clone`
1894 13342307 2023-06-21 stsp cat > $testroot/stdout.expected <<EOF
1896 13342307 2023-06-21 stsp Merged refs/remotes/origin/master into refs/heads/master: $merge_commit_id
1899 13342307 2023-06-21 stsp cmp -s $testroot/stdout $testroot/stdout.expected
1901 13342307 2023-06-21 stsp if [ $ret -ne 0 ]; then
1902 13342307 2023-06-21 stsp diff -u $testroot/stdout.expected $testroot/stdout
1904 13342307 2023-06-21 stsp test_done "$testroot" "$ret"
1907 13342307 2023-06-21 stsp test_merge_fetched_branch_remote() {
1908 13342307 2023-06-21 stsp local testroot=`test_init merge_fetched_branch_remote`
1909 13342307 2023-06-21 stsp local testurl=ssh://127.0.0.1/$testroot
1910 13342307 2023-06-21 stsp local commit_id=`git_show_head $testroot/repo`
1912 13342307 2023-06-21 stsp got clone -q $testurl/repo $testroot/repo-clone
1914 13342307 2023-06-21 stsp if [ $ret -ne 0 ]; then
1915 13342307 2023-06-21 stsp echo "got clone command failed unexpectedly" >&2
1916 13342307 2023-06-21 stsp test_done "$testroot" "$ret"
1920 13342307 2023-06-21 stsp echo "modified alpha" > $testroot/repo/alpha
1921 13342307 2023-06-21 stsp git_commit $testroot/repo -m "modified alpha"
1922 13342307 2023-06-21 stsp local commit_id2=`git_show_head $testroot/repo`
1924 13342307 2023-06-21 stsp got fetch -q -r $testroot/repo-clone > $testroot/stdout
1926 13342307 2023-06-21 stsp if [ $ret -ne 0 ]; then
1927 13342307 2023-06-21 stsp echo "got fetch command failed unexpectedly" >&2
1928 13342307 2023-06-21 stsp test_done "$testroot" "$ret"
1932 13342307 2023-06-21 stsp echo -n > $testroot/stdout.expected
1934 13342307 2023-06-21 stsp cmp -s $testroot/stdout $testroot/stdout.expected
1936 13342307 2023-06-21 stsp if [ $ret -ne 0 ]; then
1937 13342307 2023-06-21 stsp diff -u $testroot/stdout.expected $testroot/stdout
1938 13342307 2023-06-21 stsp test_done "$testroot" "$ret"
1942 13342307 2023-06-21 stsp got ref -l -r $testroot/repo-clone > $testroot/stdout
1944 13342307 2023-06-21 stsp echo "HEAD: refs/heads/master" > $testroot/stdout.expected
1945 13342307 2023-06-21 stsp echo "refs/heads/master: $commit_id" >> $testroot/stdout.expected
1946 13342307 2023-06-21 stsp echo "refs/remotes/origin/HEAD: refs/remotes/origin/master" \
1947 13342307 2023-06-21 stsp >> $testroot/stdout.expected
1948 13342307 2023-06-21 stsp echo "refs/remotes/origin/master: $commit_id2" \
1949 13342307 2023-06-21 stsp >> $testroot/stdout.expected
1951 13342307 2023-06-21 stsp cmp -s $testroot/stdout $testroot/stdout.expected
1953 13342307 2023-06-21 stsp if [ $ret -ne 0 ]; then
1954 13342307 2023-06-21 stsp diff -u $testroot/stdout.expected $testroot/stdout
1955 13342307 2023-06-21 stsp test_done "$testroot" "$ret"
1959 13342307 2023-06-21 stsp got checkout $testroot/repo-clone $testroot/wt > /dev/null
1961 13342307 2023-06-21 stsp echo "modified beta" > $testroot/wt/beta
1962 13342307 2023-06-21 stsp (cd $testroot/wt && got commit -m "modified beta" > /dev/null)
1963 13342307 2023-06-21 stsp local commit_id3=`git_show_head $testroot/repo-clone`
1965 13342307 2023-06-21 stsp (cd $testroot/wt && got update -b origin/master > /dev/null)
1966 13342307 2023-06-21 stsp (cd $testroot/wt && got merge master > \
1967 13342307 2023-06-21 stsp $testroot/stdout 2> $testroot/stderr)
1968 13342307 2023-06-21 stsp local merge_commit_id=`git_show_head $testroot/repo-clone`
1970 13342307 2023-06-21 stsp echo -n > $testroot/stdout.expected
1972 13342307 2023-06-21 stsp cmp -s $testroot/stdout $testroot/stdout.expected
1974 13342307 2023-06-21 stsp if [ $ret -ne 0 ]; then
1975 13342307 2023-06-21 stsp diff -u $testroot/stdout.expected $testroot/stdout
1976 13342307 2023-06-21 stsp test_done "$testroot" "$ret"
1980 13342307 2023-06-21 stsp echo -n "got: work tree's current branch refs/remotes/origin/master " \
1981 13342307 2023-06-21 stsp > $testroot/stderr.expected
1982 13342307 2023-06-21 stsp echo -n 'is outside the "refs/heads/" reference namespace; ' \
1983 13342307 2023-06-21 stsp >> $testroot/stderr.expected
1984 13342307 2023-06-21 stsp echo -n "update -b required: will not commit to a branch " \
1985 13342307 2023-06-21 stsp >> $testroot/stderr.expected
1986 13342307 2023-06-21 stsp echo 'outside the "refs/heads/" reference namespace' \
1987 13342307 2023-06-21 stsp >> $testroot/stderr.expected
1989 13342307 2023-06-21 stsp cmp -s $testroot/stderr $testroot/stderr.expected
1991 13342307 2023-06-21 stsp if [ $ret -ne 0 ]; then
1992 13342307 2023-06-21 stsp diff -u $testroot/stderr.expected $testroot/stderr
1994 13342307 2023-06-21 stsp test_done "$testroot" "$ret"
1997 f259c4c1 2021-09-24 stsp test_parseargs "$@"
1998 f259c4c1 2021-09-24 stsp run_test test_merge_basic
1999 179f9db0 2023-06-20 falsifian run_test test_merge_forward
2000 481cdc74 2023-07-01 falsifian run_test test_merge_forward_commit
2001 481cdc74 2023-07-01 falsifian run_test test_merge_forward_interrupt
2002 179f9db0 2023-06-20 falsifian run_test test_merge_backward
2003 f259c4c1 2021-09-24 stsp run_test test_merge_continue
2004 6b5246e4 2023-06-05 stsp run_test test_merge_continue_new_commit
2005 f259c4c1 2021-09-24 stsp run_test test_merge_abort
2006 f259c4c1 2021-09-24 stsp run_test test_merge_in_progress
2007 f259c4c1 2021-09-24 stsp run_test test_merge_path_prefix
2008 f259c4c1 2021-09-24 stsp run_test test_merge_missing_file
2009 a6a8f8bb 2021-09-24 stsp run_test test_merge_no_op
2010 4e91ef15 2021-09-26 stsp run_test test_merge_imported_branch
2011 088449d3 2021-09-26 stsp run_test test_merge_interrupt
2012 b2b3fce1 2022-10-29 op run_test test_merge_umask
2013 d51d11be 2023-02-21 op run_test test_merge_gitconfig_author
2014 13342307 2023-06-21 stsp run_test test_merge_fetched_branch
2015 13342307 2023-06-21 stsp run_test test_merge_fetched_branch_remote