Skip to content

Commit f9e4308

Browse files
davvidgitster
authored andcommitted
t7610-mergetool: prefer test_config over git config
Signed-off-by: David Aguilar <[email protected]> Signed-off-by: Junio C Hamano <[email protected]>
1 parent 4756c05 commit f9e4308

File tree

1 file changed

+9
-11
lines changed

1 file changed

+9
-11
lines changed

t/t7610-mergetool.sh

Lines changed: 9 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ Testing basic merge tool invocation'
1414
# running mergetool
1515

1616
test_expect_success 'setup' '
17-
git config rerere.enabled true &&
17+
test_config rerere.enabled true &&
1818
echo master >file1 &&
1919
echo master spaced >"spaced name" &&
2020
echo master file11 >file11 &&
@@ -112,7 +112,7 @@ test_expect_success 'custom mergetool' '
112112
'
113113

114114
test_expect_success 'mergetool crlf' '
115-
git config core.autocrlf true &&
115+
test_config core.autocrlf true &&
116116
git checkout -b test2 branch1 &&
117117
test_must_fail git merge master >/dev/null 2>&1 &&
118118
( yes "" | git mergetool file1 >/dev/null 2>&1 ) &&
@@ -129,7 +129,7 @@ test_expect_success 'mergetool crlf' '
129129
git submodule update -N &&
130130
test "$(cat submod/bar)" = "master submodule" &&
131131
git commit -m "branch1 resolved with mergetool - autocrlf" &&
132-
git config core.autocrlf false &&
132+
test_config core.autocrlf false &&
133133
git reset --hard
134134
'
135135

@@ -176,7 +176,7 @@ test_expect_success 'mergetool skips autoresolved' '
176176
test_expect_success 'mergetool merges all from subdir' '
177177
(
178178
cd subdir &&
179-
git config rerere.enabled false &&
179+
test_config rerere.enabled false &&
180180
test_must_fail git merge master &&
181181
( yes "r" | git mergetool ../submod ) &&
182182
( yes "d" "d" | git mergetool --no-prompt ) &&
@@ -190,7 +190,7 @@ test_expect_success 'mergetool merges all from subdir' '
190190
'
191191

192192
test_expect_success 'mergetool skips resolved paths when rerere is active' '
193-
git config rerere.enabled true &&
193+
test_config rerere.enabled true &&
194194
rm -rf .git/rr-cache &&
195195
git checkout -b test5 branch1 &&
196196
git submodule update -N &&
@@ -204,7 +204,7 @@ test_expect_success 'mergetool skips resolved paths when rerere is active' '
204204
'
205205

206206
test_expect_success 'conflicted stash sets up rerere' '
207-
git config rerere.enabled true &&
207+
test_config rerere.enabled true &&
208208
git checkout stash1 &&
209209
echo "Conflicting stash content" >file11 &&
210210
git stash &&
@@ -232,7 +232,7 @@ test_expect_success 'conflicted stash sets up rerere' '
232232

233233
test_expect_success 'mergetool takes partial path' '
234234
git reset --hard &&
235-
git config rerere.enabled false &&
235+
test_config rerere.enabled false &&
236236
git checkout -b test12 branch1 &&
237237
git submodule update -N &&
238238
test_must_fail git merge master &&
@@ -505,14 +505,12 @@ test_expect_success 'file with no base' '
505505

506506
test_expect_success 'custom commands override built-ins' '
507507
git checkout -b test14 branch1 &&
508-
git config mergetool.defaults.cmd "cat \"\$REMOTE\" >\"\$MERGED\"" &&
509-
git config mergetool.defaults.trustExitCode true &&
508+
test_config mergetool.defaults.cmd "cat \"\$REMOTE\" >\"\$MERGED\"" &&
509+
test_config mergetool.defaults.trustExitCode true &&
510510
test_must_fail git merge master &&
511511
git mergetool --no-prompt --tool defaults -- both &&
512512
echo master both added >expected &&
513513
test_cmp both expected &&
514-
git config --unset mergetool.defaults.cmd &&
515-
git config --unset mergetool.defaults.trustExitCode &&
516514
git reset --hard master >/dev/null 2>&1
517515
'
518516

0 commit comments

Comments
 (0)