mirror of
https://github.com/git/git
synced 2024-08-24 10:15:51 +00:00
t0003: avoid pipes with Git on LHS
Pipes ignore error codes of LHS command and thus we should not use them with Git in tests. As an alternative, use a 'tmp' file to write the Git output so we can test the exit code. Signed-off-by: Shubham Mishra <shivam828787@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
This commit is contained in:
parent
4c53a8c20f
commit
ae5d569bb2
|
@ -205,15 +205,18 @@ test_expect_success 'attribute test: read paths from stdin' '
|
||||||
test_expect_success 'attribute test: --all option' '
|
test_expect_success 'attribute test: --all option' '
|
||||||
grep -v unspecified <expect-all | sort >specified-all &&
|
grep -v unspecified <expect-all | sort >specified-all &&
|
||||||
sed -e "s/:.*//" <expect-all | uniq >stdin-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_cmp specified-all actual
|
||||||
'
|
'
|
||||||
|
|
||||||
test_expect_success 'attribute test: --cached option' '
|
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 &&
|
test_must_be_empty actual &&
|
||||||
git add .gitattributes a/.gitattributes a/b/.gitattributes &&
|
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
|
test_cmp specified-all actual
|
||||||
'
|
'
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue