t5520: 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 9d6aa64dc32b5f1b87c480eaffb8b4bb9aa10c64
1 file changed +4 -8
t/t5520-pull.sh
+4 -8
@@ -96,8 +96,7 @@ test_expect_success '--rebase' '
96 '
97 test_expect_success 'pull.rebase' '
98 git reset --hard before-rebase &&
99 - git config --bool pull.rebase true &&
100 - test_when_finished "git config --unset pull.rebase" &&
99 + test_config pull.rebase true &&
100 git pull . copy &&
101 test $(git rev-parse HEAD^) = $(git rev-parse copy) &&
102 test new = $(git show HEAD:file2)
@@ -105,8 +104,7 @@ test_expect_success 'pull.rebase' '
104
105 test_expect_success 'branch.to-rebase.rebase' '
106 git reset --hard before-rebase &&
108 - git config --bool branch.to-rebase.rebase true &&
109 - test_when_finished "git config --unset branch.to-rebase.rebase" &&
107 + test_config branch.to-rebase.rebase true &&
108 git pull . copy &&
109 test $(git rev-parse HEAD^) = $(git rev-parse copy) &&
110 test new = $(git show HEAD:file2)
@@ -114,10 +112,8 @@ test_expect_success 'branch.to-rebase.rebase' '
112
113 test_expect_success 'branch.to-rebase.rebase should override pull.rebase' '
114 git reset --hard before-rebase &&
117 - git config --bool pull.rebase true &&
118 - test_when_finished "git config --unset pull.rebase" &&
119 - git config --bool branch.to-rebase.rebase false &&
120 - test_when_finished "git config --unset branch.to-rebase.rebase" &&
115 + test_config pull.rebase true &&
116 + test_config branch.to-rebase.rebase false &&
117 git pull . copy &&
118 test $(git rev-parse HEAD^) != $(git rev-parse copy) &&
119 test new = $(git show HEAD:file2)