@@ -205,15 +205,15 @@ test_expect_success 'attribute test: read paths from stdin' '
test_expect_success 'attribute test: --all option' '
grep -v unspecified <expect-all | sort >specified-all &&
sed -e "s/:.*//" <expect-all | uniq >stdin-all &&
- git check-attr --stdin --all <stdin-all | sort >actual &&
+ git check-attr --stdin --all <stdin-all >tmp && sort tmp >actual &&
test_cmp specified-all actual
'
test_expect_success 'attribute test: --cached option' '
- git check-attr --cached --stdin --all <stdin-all | sort >actual &&
+ git check-attr --cached --stdin --all <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 <stdin-all | sort >actual &&
+ git check-attr --cached --stdin --all <stdin-all >tmp && sort tmp >actual &&
test_cmp specified-all actual
'
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 <shivam828787@gmail.com> --- t/t0003-attributes.sh | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-)