From: Shubham Mishra Date: Tue, 22 Feb 2022 11:43:13 GMT Subject: [PATCH 2/2] t0003: remove pipes Message-ID: <20220222114313.14921-3-shivam828787@gmail.com> In-Reply-To: <20220222114313.14921-1-shivam828787@gmail.com> pipes doesn't care about error codes and ignore them thus we should not use them in tests. As an easy alternative, I am using a tmp file to write from git command so we can test the exit code. Signed-off-by: Shubham Mishra --- t/t0003-attributes.sh | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/t/t0003-attributes.sh b/t/t0003-attributes.sh index b9ed612af1..51f9f6503c 100755 --- a/t/t0003-attributes.sh +++ b/t/t0003-attributes.sh @@ -205,15 +205,15 @@ test_expect_success 'attribute test: read paths from stdin' ' test_expect_success 'attribute test: --all option' ' grep -v unspecified specified-all && sed -e "s/:.*//" stdin-all && - git check-attr --stdin --all actual && + git check-attr --stdin --all tmp && sort tmp >actual && test_cmp specified-all actual ' test_expect_success 'attribute test: --cached option' ' - git check-attr --cached --stdin --all actual && + git check-attr --cached --stdin --all tmp && sort tmp >actual && test_must_be_empty actual && git add .gitattributes a/.gitattributes a/b/.gitattributes && - git check-attr --cached --stdin --all actual && + git check-attr --cached --stdin --all tmp && sort tmp >actual && test_cmp specified-all actual ' -- 2.25.1