@@ -68,22 +68,24 @@ test_expect_success 'mergetool crlf' '
6868'
6969
7070test_expect_success ' mergetool in subdir' '
71- git checkout -b test3 branch1
72- cd subdir && (
73- test_must_fail git merge master >/dev/null 2>&1 &&
74- ( yes "" | git mergetool file3 >/dev/null 2>&1 ) &&
75- test "$(cat file3)" = "master new sub") &&
76- cd ..
71+ git checkout -b test3 branch1 &&
72+ (
73+ cd subdir &&
74+ test_must_fail git merge master >/dev/null 2>&1 &&
75+ ( yes "" | git mergetool file3 >/dev/null 2>&1 ) &&
76+ test "$(cat file3)" = "master new sub"
77+ )
7778'
7879
7980test_expect_success ' mergetool on file in parent dir' '
80- cd subdir && (
81- ( yes "" | git mergetool ../file1 >/dev/null 2>&1 ) &&
82- ( yes "" | git mergetool ../file2 >/dev/null 2>&1 ) &&
83- test "$(cat ../file1)" = "master updated" &&
84- test "$(cat ../file2)" = "master new" &&
85- git commit -m "branch1 resolved with mergetool - subdir") &&
86- cd ..
81+ (
82+ cd subdir &&
83+ ( yes "" | git mergetool ../file1 >/dev/null 2>&1 ) &&
84+ ( yes "" | git mergetool ../file2 >/dev/null 2>&1 ) &&
85+ test "$(cat ../file1)" = "master updated" &&
86+ test "$(cat ../file2)" = "master new" &&
87+ git commit -m "branch1 resolved with mergetool - subdir"
88+ )
8789'
8890
8991test_expect_success ' mergetool skips autoresolved' '
@@ -96,16 +98,17 @@ test_expect_success 'mergetool skips autoresolved' '
9698'
9799
98100test_expect_success ' mergetool merges all from subdir' '
99- cd subdir && (
100- git config rerere.enabled false &&
101- test_must_fail git merge master &&
102- git mergetool --no-prompt &&
103- test "$(cat ../file1)" = "master updated" &&
104- test "$(cat ../file2)" = "master new" &&
105- test "$(cat file3)" = "master new sub" &&
106- git add ../file1 ../file2 file3 &&
107- git commit -m "branch2 resolved by mergetool from subdir") &&
108- cd ..
101+ (
102+ cd subdir &&
103+ git config rerere.enabled false &&
104+ test_must_fail git merge master &&
105+ git mergetool --no-prompt &&
106+ test "$(cat ../file1)" = "master updated" &&
107+ test "$(cat ../file2)" = "master new" &&
108+ test "$(cat file3)" = "master new sub" &&
109+ git add ../file1 ../file2 file3 &&
110+ git commit -m "branch2 resolved by mergetool from subdir"
111+ )
109112'
110113
111114test_done
0 commit comments