Skip to content

Commit 57d93c1

Browse files
Denton-Lgitster
authored andcommitted
t7610: add mergetool --gui tests
In 063f2bd (mergetool: accept -g/--[no-]gui as arguments, 2018-10-24), mergetool was taught the --gui option but no tests were added to ensure that it was working properly. Add a test to ensure that it works. Signed-off-by: Denton Liu <[email protected]> Signed-off-by: Junio C Hamano <[email protected]>
1 parent e9d309e commit 57d93c1

File tree

1 file changed

+22
-0
lines changed

1 file changed

+22
-0
lines changed

t/t7610-mergetool.sh

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -145,6 +145,28 @@ test_expect_success 'custom mergetool' '
145145
git commit -m "branch1 resolved with mergetool"
146146
'
147147

148+
test_expect_success 'gui mergetool' '
149+
test_config merge.guitool myguitool &&
150+
test_config mergetool.myguitool.cmd "(printf \"gui \" && cat \"\$REMOTE\") >\"\$MERGED\"" &&
151+
test_config mergetool.myguitool.trustExitCode true &&
152+
test_when_finished "git reset --hard" &&
153+
git checkout -b test$test_count branch1 &&
154+
git submodule update -N &&
155+
test_must_fail git merge master &&
156+
( yes "" | git mergetool --gui both ) &&
157+
( yes "" | git mergetool -g file1 file1 ) &&
158+
( yes "" | git mergetool --gui file2 "spaced name" ) &&
159+
( yes "" | git mergetool --gui subdir/file3 ) &&
160+
( yes "d" | git mergetool --gui file11 ) &&
161+
( yes "d" | git mergetool --gui file12 ) &&
162+
( yes "l" | git mergetool --gui submod ) &&
163+
test "$(cat file1)" = "gui master updated" &&
164+
test "$(cat file2)" = "gui master new" &&
165+
test "$(cat subdir/file3)" = "gui master new sub" &&
166+
test "$(cat submod/bar)" = "branch1 submodule" &&
167+
git commit -m "branch1 resolved with mergetool"
168+
'
169+
148170
test_expect_success 'mergetool crlf' '
149171
test_when_finished "git reset --hard" &&
150172
# This test_config line must go after the above reset line so that

0 commit comments

Comments
 (0)