diff options
author | Brandon Casey <drafnel@gmail.com> | 2010-07-20 16:55:31 -0500 |
---|---|---|
committer | Junio C Hamano <gitster@pobox.com> | 2010-07-21 11:54:34 -0700 |
commit | b1edaf669d483e983f1849ce804baa178387e9a9 (patch) | |
tree | 3cf240aa76f0576088b379384891d54aa05eb6bf /t/t2017-checkout-orphan.sh | |
parent | bdcaa325b47fcacfecb781a28801aafc249ba288 (diff) | |
download | git-b1edaf669d483e983f1849ce804baa178387e9a9.tar.gz |
t/: work around one-shot variable assignment with test_must_fail
See e2007832552ccea9befed9003580c494f09e666e
Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 't/t2017-checkout-orphan.sh')
-rwxr-xr-x | t/t2017-checkout-orphan.sh | 36 |
1 files changed, 30 insertions, 6 deletions
diff --git a/t/t2017-checkout-orphan.sh b/t/t2017-checkout-orphan.sh index be88d4b5ee..81cb393a95 100755 --- a/t/t2017-checkout-orphan.sh +++ b/t/t2017-checkout-orphan.sh @@ -69,7 +69,11 @@ test_expect_success '--orphan makes reflog by default' ' git config --unset core.logAllRefUpdates && git checkout --orphan delta && ! test -f .git/logs/refs/heads/delta && - test_must_fail PAGER= git reflog show delta && + ( + PAGER= && + export PAGER && + test_must_fail git reflog show delta + ) && git commit -m Delta && test -f .git/logs/refs/heads/delta && PAGER= git reflog show delta @@ -80,17 +84,29 @@ test_expect_success '--orphan does not make reflog when core.logAllRefUpdates = git config core.logAllRefUpdates false && git checkout --orphan epsilon && ! test -f .git/logs/refs/heads/epsilon && - test_must_fail PAGER= git reflog show epsilon && + ( + PAGER= && + export PAGER && + test_must_fail git reflog show epsilon + ) && git commit -m Epsilon && ! test -f .git/logs/refs/heads/epsilon && - test_must_fail PAGER= git reflog show epsilon + ( + PAGER= && + export PAGER && + test_must_fail git reflog show epsilon + ) ' test_expect_success '--orphan with -l makes reflog when core.logAllRefUpdates = false' ' git checkout master && git checkout -l --orphan zeta && test -f .git/logs/refs/heads/zeta && - test_must_fail PAGER= git reflog show zeta && + ( + PAGER= && + export PAGER && + test_must_fail git reflog show zeta + ) && git commit -m Zeta && PAGER= git reflog show zeta ' @@ -99,10 +115,18 @@ test_expect_success 'giving up --orphan not committed when -l and core.logAllRef git checkout master && git checkout -l --orphan eta && test -f .git/logs/refs/heads/eta && - test_must_fail PAGER= git reflog show eta && + ( + PAGER= && + export PAGER && + test_must_fail git reflog show eta + ) && git checkout master && ! test -f .git/logs/refs/heads/eta && - test_must_fail PAGER= git reflog show eta + ( + PAGER= && + export PAGER && + test_must_fail git reflog show eta + ) ' test_expect_success '--orphan is rejected with an existing name' ' |