diff options
author | Yann Droneaud <ydroneaud@opteya.com> | 2013-03-24 22:06:07 +0100 |
---|---|---|
committer | Junio C Hamano <gitster@pobox.com> | 2013-03-25 08:50:53 -0700 |
commit | 9d6aa64dc32b5f1b87c480eaffb8b4bb9aa10c64 (patch) | |
tree | 4bcff140c5b8f4858828dd1c9175be111c268499 /t | |
parent | t4202: use test_config/test_unconfig to set/unset git config variables (diff) | |
download | tgif-9d6aa64dc32b5f1b87c480eaffb8b4bb9aa10c64.tar.xz |
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>
Diffstat (limited to 't')
-rwxr-xr-x | t/t5520-pull.sh | 12 |
1 files changed, 4 insertions, 8 deletions
diff --git a/t/t5520-pull.sh b/t/t5520-pull.sh index 35304b41e9..cb1a4c581f 100755 --- a/t/t5520-pull.sh +++ b/t/t5520-pull.sh @@ -96,8 +96,7 @@ test_expect_success '--rebase' ' ' test_expect_success 'pull.rebase' ' git reset --hard before-rebase && - git config --bool pull.rebase true && - test_when_finished "git config --unset pull.rebase" && + test_config pull.rebase true && git pull . copy && test $(git rev-parse HEAD^) = $(git rev-parse copy) && test new = $(git show HEAD:file2) @@ -105,8 +104,7 @@ test_expect_success 'pull.rebase' ' test_expect_success 'branch.to-rebase.rebase' ' git reset --hard before-rebase && - git config --bool branch.to-rebase.rebase true && - test_when_finished "git config --unset branch.to-rebase.rebase" && + test_config branch.to-rebase.rebase true && git pull . copy && test $(git rev-parse HEAD^) = $(git rev-parse copy) && test new = $(git show HEAD:file2) @@ -114,10 +112,8 @@ test_expect_success 'branch.to-rebase.rebase' ' test_expect_success 'branch.to-rebase.rebase should override pull.rebase' ' git reset --hard before-rebase && - git config --bool pull.rebase true && - test_when_finished "git config --unset pull.rebase" && - git config --bool branch.to-rebase.rebase false && - test_when_finished "git config --unset branch.to-rebase.rebase" && + test_config pull.rebase true && + test_config branch.to-rebase.rebase false && git pull . copy && test $(git rev-parse HEAD^) != $(git rev-parse copy) && test new = $(git show HEAD:file2) |