Skip to content

Commit

Permalink
t7502: use test_config to set/unset git config variables
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Yann Droneaud authored and Junio C Hamano committed Mar 25, 2013
1 parent 5d76ef2 commit 464be63
Showing 1 changed file with 3 additions and 5 deletions.
8 changes: 3 additions & 5 deletions t/t7502-commit.sh
Original file line number Diff line number Diff line change
Expand Up @@ -171,10 +171,9 @@ test_expect_success 'verbose' '

test_expect_success 'verbose respects diff config' '
git config color.diff always &&
test_config color.diff always &&
git status -v >actual &&
grep "\[1mdiff --git" actual &&
git config --unset color.diff
grep "\[1mdiff --git" actual
'

test_expect_success 'cleanup commit messages (verbatim option,-t)' '
Expand Down Expand Up @@ -518,8 +517,7 @@ use_template="-t template"
try_commit_status_combo

test_expect_success 'commit --status with custom comment character' '
test_when_finished "git config --unset core.commentchar" &&
git config core.commentchar ";" &&
test_config core.commentchar ";" &&
try_commit --status &&
test_i18ngrep "^; Changes to be committed:" .git/COMMIT_EDITMSG
'
Expand Down

0 comments on commit 464be63

Please sign in to comment.