]> Kevux Git Server - rit/commitdiff
tests: drop use of 'tee' that hides exit status
authorJunio C Hamano <gitster@pobox.com>
Thu, 8 Aug 2024 21:19:25 +0000 (14:19 -0700)
committerJunio C Hamano <gitster@pobox.com>
Fri, 9 Aug 2024 01:08:10 +0000 (18:08 -0700)
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 <gitster@pobox.com>
t/t1001-read-tree-m-2way.sh
t/t5523-push-upstream.sh

index 3fb1b0c..9dc6eb3 100755 (executable)
@@ -397,7 +397,7 @@ test_expect_success 'a/b vs a, plus c/d case setup.' '
 
 test_expect_success 'a/b vs a, plus c/d case test.' '
        read_tree_u_must_succeed -u -m "$treeH" "$treeM" &&
-       git ls-files --stage | tee >treeMcheck.out &&
+       git ls-files --stage >treeMcheck.out &&
        test_cmp treeM.out treeMcheck.out
 '
 
index c9acc07..77c4075 100755 (executable)
@@ -116,14 +116,14 @@ test_expect_success TTY 'push --no-progress suppresses progress' '
 test_expect_success TTY 'quiet push' '
        ensure_fresh_upstream &&
 
-       test_terminal git push --quiet --no-progress upstream main 2>&1 | tee output &&
+       test_terminal git push --quiet --no-progress upstream main >output 2>&1 &&
        test_must_be_empty output
 '
 
 test_expect_success TTY 'quiet push -u' '
        ensure_fresh_upstream &&
 
-       test_terminal git push --quiet -u --no-progress upstream main 2>&1 | tee output &&
+       test_terminal git push --quiet -u --no-progress upstream main >output 2>&1 &&
        test_must_be_empty output
 '