Skip to content

Commit 0d66f60

Browse files
committed
tests: drop use of 'tee' that hides exit status
A few tests have "| tee output" downstream of a git command, and then inspect the contents of the file. The net effect is that we use an extra process, and hide the exit status from the upstream git command. In any of these tests, I do not see a reason why we want to hide a possible failure from these git commands. Replace the use of tee with a plain simple redirection. Signed-off-by: Junio C Hamano <[email protected]>
1 parent dbecc61 commit 0d66f60

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

t/t1001-read-tree-m-2way.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -397,7 +397,7 @@ test_expect_success 'a/b vs a, plus c/d case setup.' '
397397

398398
test_expect_success 'a/b vs a, plus c/d case test.' '
399399
read_tree_u_must_succeed -u -m "$treeH" "$treeM" &&
400-
git ls-files --stage | tee >treeMcheck.out &&
400+
git ls-files --stage >treeMcheck.out &&
401401
test_cmp treeM.out treeMcheck.out
402402
'
403403

t/t5523-push-upstream.sh

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -116,14 +116,14 @@ test_expect_success TTY 'push --no-progress suppresses progress' '
116116
test_expect_success TTY 'quiet push' '
117117
ensure_fresh_upstream &&
118118
119-
test_terminal git push --quiet --no-progress upstream main 2>&1 | tee output &&
119+
test_terminal git push --quiet --no-progress upstream main >output 2>&1 &&
120120
test_must_be_empty output
121121
'
122122

123123
test_expect_success TTY 'quiet push -u' '
124124
ensure_fresh_upstream &&
125125
126-
test_terminal git push --quiet -u --no-progress upstream main 2>&1 | tee output &&
126+
test_terminal git push --quiet -u --no-progress upstream main >output 2>&1 &&
127127
test_must_be_empty output
128128
'
129129

0 commit comments

Comments
 (0)