@matheusbsbs / matheus-bagliano / commits / b1edaf669d
Fork 0

t/: work around one-shot variable assignment with test_must_fail

See e2007832552ccea9befed9003580c494f09e666e Signed-off-by: Junio C Hamano <gitster@pobox.com>

Brandon Casey committed Jul 20, 2010 at 16:55 UTC b1edaf669d483e983f1849ce804baa178387e9a9
3 files changed +40 -8
t/t2017-checkout-orphan.sh
+30 -6
@@ -69,7 +69,11 @@ test_expect_success '--orphan makes reflog by default' '
69 git config --unset core.logAllRefUpdates &&
70 git checkout --orphan delta &&
71 ! test -f .git/logs/refs/heads/delta &&
72 - test_must_fail PAGER= git reflog show delta &&
72 + (
73 + PAGER= &&
74 + export PAGER &&
75 + test_must_fail git reflog show delta
76 + ) &&
77 git commit -m Delta &&
78 test -f .git/logs/refs/heads/delta &&
79 PAGER= git reflog show delta
@@ -80,17 +84,29 @@ test_expect_success '--orphan does not make reflog when core.logAllRefUpdates =
84 git config core.logAllRefUpdates false &&
85 git checkout --orphan epsilon &&
86 ! test -f .git/logs/refs/heads/epsilon &&
83 - test_must_fail PAGER= git reflog show epsilon &&
87 + (
88 + PAGER= &&
89 + export PAGER &&
90 + test_must_fail git reflog show epsilon
91 + ) &&
92 git commit -m Epsilon &&
93 ! test -f .git/logs/refs/heads/epsilon &&
86 - test_must_fail PAGER= git reflog show epsilon
94 + (
95 + PAGER= &&
96 + export PAGER &&
97 + test_must_fail git reflog show epsilon
98 + )
99 '
100
101 test_expect_success '--orphan with -l makes reflog when core.logAllRefUpdates = false' '
102 git checkout master &&
103 git checkout -l --orphan zeta &&
104 test -f .git/logs/refs/heads/zeta &&
93 - test_must_fail PAGER= git reflog show zeta &&
105 + (
106 + PAGER= &&
107 + export PAGER &&
108 + test_must_fail git reflog show zeta
109 + ) &&
110 git commit -m Zeta &&
111 PAGER= git reflog show zeta
112 '
@@ -99,10 +115,18 @@ test_expect_success 'giving up --orphan not committed when -l and core.logAllRef
115 git checkout master &&
116 git checkout -l --orphan eta &&
117 test -f .git/logs/refs/heads/eta &&
102 - test_must_fail PAGER= git reflog show eta &&
118 + (
119 + PAGER= &&
120 + export PAGER &&
121 + test_must_fail git reflog show eta
122 + ) &&
123 git checkout master &&
124 ! test -f .git/logs/refs/heads/eta &&
105 - test_must_fail PAGER= git reflog show eta
125 + (
126 + PAGER= &&
127 + export PAGER &&
128 + test_must_fail git reflog show eta
129 + )
130 '
131
132 test_expect_success '--orphan is rejected with an existing name' '
t/t3200-branch.sh
+5 -1
@@ -237,7 +237,11 @@ test_expect_success 'checkout -b does not make reflog when core.logAllRefUpdates
237 git config core.logAllRefUpdates false &&
238 git checkout -b beta &&
239 ! test -f .git/logs/refs/heads/beta &&
240 - test_must_fail PAGER= git reflog show beta
240 + (
241 + PAGER= &&
242 + export PAGER &&
243 + test_must_fail git reflog show beta
244 + )
245 '
246
247 test_expect_success 'checkout -b with -l makes reflog when core.logAllRefUpdates = false' '
t/t3301-notes.sh
+5 -1
@@ -693,7 +693,11 @@ test_expect_success 'create note from non-existing note with "git notes add -c"
693 git add a10 &&
694 test_tick &&
695 git commit -m 10th &&
696 - test_must_fail MSG="yet another note" git notes add -c deadbeef &&
696 + (
697 + MSG="yet another note" &&
698 + export MSG &&
699 + test_must_fail git notes add -c deadbeef
700 + ) &&
701 test_must_fail git notes list HEAD
702 '
703