t1600-index: don't run git commands upstream of a pipe

Signed-off-by: SZEDER Gábor <szeder.dev@gmail.com> Acked-by: Derrick Stolee <dstolee@microsoft.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>

SZEDER Gábor committed Aug 26, 2021 at 23:00 UTC bdfe1f0d691a14f187c2f74f3731457977a9759e
1 file changed +6 -3
t/t1600-index.sh
+6 -3
@@ -13,7 +13,8 @@ test_expect_success 'bogus GIT_INDEX_VERSION issues warning' '
13 rm -f .git/index &&
14 GIT_INDEX_VERSION=2bogus &&
15 export GIT_INDEX_VERSION &&
16 - git add a 2>&1 | sed "s/[0-9]//" >actual.err &&
16 + git add a 2>err &&
17 + sed "s/[0-9]//" err >actual.err &&
18 sed -e "s/ Z$/ /" <<-\EOF >expect.err &&
19 warning: GIT_INDEX_VERSION set, but the value is invalid.
20 Using version Z
@@ -27,7 +28,8 @@ test_expect_success 'out of bounds GIT_INDEX_VERSION issues warning' '
28 rm -f .git/index &&
29 GIT_INDEX_VERSION=1 &&
30 export GIT_INDEX_VERSION &&
30 - git add a 2>&1 | sed "s/[0-9]//" >actual.err &&
31 + git add a 2>err &&
32 + sed "s/[0-9]//" err >actual.err &&
33 sed -e "s/ Z$/ /" <<-\EOF >expect.err &&
34 warning: GIT_INDEX_VERSION set, but the value is invalid.
35 Using version Z
@@ -50,7 +52,8 @@ test_expect_success 'out of bounds index.version issues warning' '
52 sane_unset GIT_INDEX_VERSION &&
53 rm -f .git/index &&
54 git config --add index.version 1 &&
53 - git add a 2>&1 | sed "s/[0-9]//" >actual.err &&
55 + git add a 2>err &&
56 + sed "s/[0-9]//" err >actual.err &&
57 sed -e "s/ Z$/ /" <<-\EOF >expect.err &&
58 warning: index.version set, but the value is invalid.
59 Using version Z