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 <ydroneaud@opteya.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Yann Droneaud committed
Mar 24, 2013 at 22:06 UTC
464be6307c898ff314c723626b5ee61387dab9b4
1 file changed
+3
-5
t/t7502-commit.sh
+3
-5
@@ -171,10 +171,9 @@ test_expect_success 'verbose' '
171
172
test_expect_success 'verbose respects diff config' '
173
174
- git config color.diff always &&
174
+ test_config color.diff always &&
175
git status -v >actual &&
176
- grep "\[1mdiff --git" actual &&
177
- git config --unset color.diff
176
+ grep "\[1mdiff --git" actual
177
'
178
179
test_expect_success 'cleanup commit messages (verbatim option,-t)' '
@@ -518,8 +517,7 @@ use_template="-t template"
517
try_commit_status_combo
518
519
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 ";" &&
521
try_commit --status &&
522
test_i18ngrep "^; Changes to be committed:" .git/COMMIT_EDITMSG
523
'