t7610: don't rely on state from previous test

If the repository must be in a particular state (beyond what is already done by the 'setup' test case) before the test can run, make the necessary repository changes in the test script even if it means duplicating some lines of code from the previous 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 b696ac9aafd57fad68383b4edd31784462d34bcb
1 file changed +6
t/t7610-mergetool.sh
+6
@@ -181,8 +181,12 @@ test_expect_success 'mergetool in subdir' '
181 '
182
183 test_expect_success 'mergetool on file in parent dir' '
184 + git reset --hard &&
185 + git submodule update -N &&
186 (
187 cd subdir &&
188 + test_must_fail git merge master >/dev/null 2>&1 &&
189 + ( yes "" | git mergetool file3 >/dev/null 2>&1 ) &&
190 ( yes "" | git mergetool ../file1 >/dev/null 2>&1 ) &&
191 ( yes "" | git mergetool ../file2 ../spaced\ name >/dev/null 2>&1 ) &&
192 ( yes "" | git mergetool ../both >/dev/null 2>&1 ) &&
@@ -652,6 +656,8 @@ test_expect_success 'mergetool -Oorder-file is honored' '
656 test_config diff.orderFile order-file &&
657 test_config mergetool.myecho.cmd "echo \"\$LOCAL\"" &&
658 test_config mergetool.myecho.trustExitCode true &&
659 + echo b >order-file &&
660 + echo a >>order-file &&
661 test_must_fail git merge order-file-side1 &&
662 cat >expect <<-\EOF &&
663 Merging: