Skip to content

Commit 464be63

Browse files
ydroneaudgitster
authored andcommitted
t7502: use test_config to set/unset git config variables
Instead of using construct such as: test_when_finished "git config --unset <key>" git config <key> <value> uses test_config <key> <value> The latter takes care of removing <key> at the end of the test. Signed-off-by: Yann Droneaud <[email protected]> Signed-off-by: Junio C Hamano <[email protected]>
1 parent 5d76ef2 commit 464be63

File tree

1 file changed

+3
-5
lines changed

1 file changed

+3
-5
lines changed

t/t7502-commit.sh

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -171,10 +171,9 @@ test_expect_success 'verbose' '
171171

172172
test_expect_success 'verbose respects diff config' '
173173
174-
git config color.diff always &&
174+
test_config color.diff always &&
175175
git status -v >actual &&
176-
grep "\[1mdiff --git" actual &&
177-
git config --unset color.diff
176+
grep "\[1mdiff --git" actual
178177
'
179178

180179
test_expect_success 'cleanup commit messages (verbatim option,-t)' '
@@ -518,8 +517,7 @@ use_template="-t template"
518517
try_commit_status_combo
519518

520519
test_expect_success 'commit --status with custom comment character' '
521-
test_when_finished "git config --unset core.commentchar" &&
522-
git config core.commentchar ";" &&
520+
test_config core.commentchar ";" &&
523521
try_commit --status &&
524522
test_i18ngrep "^; Changes to be committed:" .git/COMMIT_EDITMSG
525523
'

0 commit comments

Comments
 (0)