]> git.ipfire.org Git - thirdparty/git.git/commitdiff
t1600-index: don't run git commands upstream of a pipe
authorSZEDER Gábor <szeder.dev@gmail.com>
Thu, 26 Aug 2021 21:00:00 +0000 (23:00 +0200)
committerJunio C Hamano <gitster@pobox.com>
Wed, 8 Sep 2021 06:23:47 +0000 (23:23 -0700)
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>
t/t1600-index.sh

index 5d10cec67a5c851546d82fca56de0caf4bad9f21..aa88fc30cedc5d386912062c24d69f9bfab3e962 100755 (executable)
@@ -13,7 +13,8 @@ test_expect_success 'bogus GIT_INDEX_VERSION issues warning' '
                rm -f .git/index &&
                GIT_INDEX_VERSION=2bogus &&
                export GIT_INDEX_VERSION &&
-               git add a 2>&1 | sed "s/[0-9]//" >actual.err &&
+               git add a 2>err &&
+               sed "s/[0-9]//" err >actual.err &&
                sed -e "s/ Z$/ /" <<-\EOF >expect.err &&
                        warning: GIT_INDEX_VERSION set, but the value is invalid.
                        Using version Z
@@ -27,7 +28,8 @@ test_expect_success 'out of bounds GIT_INDEX_VERSION issues warning' '
                rm -f .git/index &&
                GIT_INDEX_VERSION=1 &&
                export GIT_INDEX_VERSION &&
-               git add a 2>&1 | sed "s/[0-9]//" >actual.err &&
+               git add a 2>err &&
+               sed "s/[0-9]//" err >actual.err &&
                sed -e "s/ Z$/ /" <<-\EOF >expect.err &&
                        warning: GIT_INDEX_VERSION set, but the value is invalid.
                        Using version Z
@@ -50,7 +52,8 @@ test_expect_success 'out of bounds index.version issues warning' '
                sane_unset GIT_INDEX_VERSION &&
                rm -f .git/index &&
                git config --add index.version 1 &&
-               git add a 2>&1 | sed "s/[0-9]//" >actual.err &&
+               git add a 2>err &&
+               sed "s/[0-9]//" err >actual.err &&
                sed -e "s/ Z$/ /" <<-\EOF >expect.err &&
                        warning: index.version set, but the value is invalid.
                        Using version Z