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-v3
Fetch-It-Via: git fetch https://github.com/gitgitgadget/git pr-2260/poojarysrujith/microproject-init-pipe-v3
Pull-Request: https://github.com/gitgitgadget/git/pull/2260
Range-diff vs v2:
1: 7d118290ce ! 1: a70ccdf49e [Outreachy PATCH] t0001: avoid pipes in test scripts
@@ t/t0001-init.sh: test_expect_success 'default ref format' '
) &&
- 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 &&
++ 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
' t/t0001-init.sh | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)