[PATCH v4] [Outreachy PATCH] t0001: avoid pipes in test scripts
- From
- Srujith A Poojary via GitGitGadget <gitgitgadget@gmail.com>
- Date
- Oct 29, 2026, 14:34 UTC
- Message-ID
- <pull.2260.v4.git.1793284463139.gitgitgadget@gmail.com>
- In-Reply-To
- <pull.2260.git.1792299301663.gitgitgadget@gmail.com>
From: Srujith Poojary <poojarysrujith@gmail.com>
Avoid piping output from git version directly into sed to ensure that any command failure is properly caught by test scripts.
Signed-off-by: Srujith Poojary <poojarysrujith@gmail.com>
---
[Outreachy PATCH] t0001: avoid pipes in test scriptsPublished-As: https://github.com/gitgitgadget/git/releases/tag/pr-2260%2Fpoojarysrujith%2Fmicroproject-init-pipe-v4 Fetch-It-Via: git fetch https://github.com/gitgitgadget/git pr-2260/poojarysrujith/microproject-init-pipe-v4 Pull-Request: https://github.com/gitgitgadget/git/pull/2260
Range-diff vs v3:
1: a70ccdf49e ! 1: 4373eef413 [Outreachy PATCH] t0001: avoid pipes in test scripts
@@ Commit message
[Outreachy PATCH] t0001: avoid pipes in test scripts
Avoid piping output from git version directly into sed to ensure
-
that any command failure is properly caught by test scripts.
Signed-off-by: Srujith Poojary <poojarysrujith@gmail.com>t/t0001-init.sh | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/t/t0001-init.sh b/t/t0001-init.sh index f1d227f271..c8c74f681b 100755 --- a/t/t0001-init.sh +++ b/t/t0001-init.sh @@ -678,7 +678,8 @@ test_expect_success 'default ref format' ' sane_unset GIT_DEFAULT_REF_STORAGE_FORMAT && git init refformat ) && - git version --build-options | sed -ne "s/^default-ref-storage-format: //p" >expect && + git version --build-options >build-options && + sed -ne "s/^default-ref-storage-format: //p" build-options >expect && git -C refformat rev-parse --show-ref-storage-format >actual && test_cmp expect actual ' base-commit: 6de20f6092dcf9bdb1c8efe03db4b70c82b423dd
-- gitgitgadget