t4304: 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. 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> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Yann Droneaud committed
Mar 24, 2013 at 22:06 UTC
aac6c2f4bcea6bd371ef8b25edb991673a14d5b3
1 file changed
+1
-2
t/t3404-rebase-interactive.sh
+1
-2
@@ -937,8 +937,7 @@ test_expect_success 'rebase --edit-todo can be used to modify todo' '
937
test_expect_success 'rebase -i respects core.commentchar' '
938
git reset --hard &&
939
git checkout E^0 &&
940
- git config core.commentchar "\\" &&
941
- test_when_finished "git config --unset core.commentchar" &&
940
+ test_config core.commentchar "\\" &&
941
write_script remove-all-but-first.sh <<-\EOF &&
942
sed -e "2,\$s/^/\\\\/" "$1" >"$1.tmp" &&
943
mv "$1.tmp" "$1"