[PATCH 05/15] t4304: use test_config to set/unset git config variables
- From
Yann Droneaud <ydroneaud@opteya.com>
- Date
- Mar 24, 2013, 21:06 UTC
- Message-ID
- <46b1dba5f3e4aeec0023bc796a5967b8e5399c00.1364158574.git.ydroneaud@opteya.com>
- In-Reply-To
- <cover.1364158574.git.ydroneaud@opteya.com>
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.Tests are modified to assume correct (default) configuration at entry, and to reset the modified configuration variables at the end.
Signed-off-by: Yann Droneaud <ydroneaud@opteya.com> --- t/t3404-rebase-interactive.sh | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-)
diff --git a/t/t3404-rebase-interactive.sh b/t/t3404-rebase-interactive.sh index 15dcbd4..a58406d 100755 --- a/t/t3404-rebase-interactive.sh +++ b/t/t3404-rebase-interactive.sh @@ -937,8 +937,7 @@ test_expect_success 'rebase --edit-todo can be used to modify todo' ' test_expect_success 'rebase -i respects core.commentchar' ' git reset --hard && git checkout E^0 && - git config core.commentchar "\\" && - test_when_finished "git config --unset core.commentchar" && + test_config core.commentchar "\\" && write_script remove-all-but-first.sh <<-\EOF && sed -e "2,\$s/^/\\\\/" "$1" >"$1.tmp" && mv "$1.tmp" "$1"
-- 1.7.11.7