t7610: move setup code to the 'setup' test case
Multiple test cases depend on these hunks, so move them to the 'setup' test case. This is a step toward making the tests more independent so that if one test fails it doesn't cause subsequent tests to fail. Signed-off-by: Richard Hansen <hansenr@google.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Richard Hansen committed
Jan 10, 2017 at 15:41 UTC
157acfcf353ead1cbd0fff1d9f26ff0b4f1020bc
1 file changed
+35
-30
t/t7610-mergetool.sh
+35
-30
@@ -55,6 +55,22 @@ test_expect_success 'setup' '
55
git rm file12 &&
56
git commit -m "branch1 changes" &&
57
58
+ git checkout -b delete-base branch1 &&
59
+ mkdir -p a/a &&
60
+ (echo one; echo two; echo 3; echo 4) >a/a/file.txt &&
61
+ git add a/a/file.txt &&
62
+ git commit -m"base file" &&
63
+ git checkout -b move-to-b delete-base &&
64
+ mkdir -p b/b &&
65
+ git mv a/a/file.txt b/b/file.txt &&
66
+ (echo one; echo two; echo 4) >b/b/file.txt &&
67
+ git commit -a -m"move to b" &&
68
+ git checkout -b move-to-c delete-base &&
69
+ mkdir -p c/c &&
70
+ git mv a/a/file.txt c/c/file.txt &&
71
+ (echo one; echo two; echo 3) >c/c/file.txt &&
72
+ git commit -a -m"move to c" &&
73
+
74
git checkout -b stash1 master &&
75
echo stash1 change file11 >file11 &&
76
git add file11 &&
@@ -86,6 +102,23 @@ test_expect_success 'setup' '
102
git rm file11 &&
103
git commit -m "master updates" &&
104
105
+ git clean -fdx &&
106
+ git checkout -b order-file-start master &&
107
+ echo start >a &&
108
+ echo start >b &&
109
+ git add a b &&
110
+ git commit -m start &&
111
+ git checkout -b order-file-side1 order-file-start &&
112
+ echo side1 >a &&
113
+ echo side1 >b &&
114
+ git add a b &&
115
+ git commit -m side1 &&
116
+ git checkout -b order-file-side2 order-file-start &&
117
+ echo side2 >a &&
118
+ echo side2 >b &&
119
+ git add a b &&
120
+ git commit -m side2 &&
121
+
122
git config merge.tool mytool &&
123
git config mergetool.mytool.cmd "cat \"\$REMOTE\" >\"\$MERGED\"" &&
124
git config mergetool.mytool.trustExitCode true &&
@@ -244,21 +277,7 @@ test_expect_success 'mergetool takes partial path' '
277
'
278
279
test_expect_success 'mergetool delete/delete conflict' '
247
- git checkout -b delete-base branch1 &&
248
- mkdir -p a/a &&
249
- (echo one; echo two; echo 3; echo 4) >a/a/file.txt &&
250
- git add a/a/file.txt &&
251
- git commit -m"base file" &&
252
- git checkout -b move-to-b delete-base &&
253
- mkdir -p b/b &&
254
- git mv a/a/file.txt b/b/file.txt &&
255
- (echo one; echo two; echo 4) >b/b/file.txt &&
256
- git commit -a -m"move to b" &&
257
- git checkout -b move-to-c delete-base &&
258
- mkdir -p c/c &&
259
- git mv a/a/file.txt c/c/file.txt &&
260
- (echo one; echo two; echo 3) >c/c/file.txt &&
261
- git commit -a -m"move to c" &&
280
+ git checkout move-to-c &&
281
test_must_fail git merge move-to-b &&
282
echo d | git mergetool a/a/file.txt &&
283
! test -f a/a/file.txt &&
@@ -608,26 +627,12 @@ test_expect_success MKTEMP 'temporary filenames are used with mergetool.writeToT
627
'
628
629
test_expect_success 'diff.orderFile configuration is honored' '
630
+ git checkout order-file-side2 &&
631
test_config diff.orderFile order-file &&
632
test_config mergetool.myecho.cmd "echo \"\$LOCAL\"" &&
633
test_config mergetool.myecho.trustExitCode true &&
634
echo b >order-file &&
635
echo a >>order-file &&
616
- git checkout -b order-file-start master &&
617
- echo start >a &&
618
- echo start >b &&
619
- git add a b &&
620
- git commit -m start &&
621
- git checkout -b order-file-side1 order-file-start &&
622
- echo side1 >a &&
623
- echo side1 >b &&
624
- git add a b &&
625
- git commit -m side1 &&
626
- git checkout -b order-file-side2 order-file-start &&
627
- echo side2 >a &&
628
- echo side2 >b &&
629
- git add a b &&
630
- git commit -m side2 &&
636
test_must_fail git merge order-file-side1 &&
637
cat >expect <<-\EOF &&
638
Merging: