diff options
author | Đoàn Trần Công Danh <congdanhqx@gmail.com> | 2021-08-21 04:36:34 +0300 |
---|---|---|
committer | Junio C Hamano <gitster@pobox.com> | 2021-08-25 21:45:54 +0300 |
commit | 1549577338c7c3a4455e9b3f05f9c8740b8e5337 (patch) | |
tree | 3c039efbc1f501f35dabee5c46d8cf669f9762dc /t | |
parent | 597fa8cb430179ec2b28e2d39a857af25717c98c (diff) |
t6300: check for cat-file exit status code
In test_atom(), we're piping the output of cat-file to tail(1),
thus, losing its exit status.
Let's use a temporary file to preserve git exit status code.
Signed-off-by: Đoàn Trần Công Danh <congdanhqx@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 't')
-rwxr-xr-x | t/t6300-for-each-ref.sh | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/t/t6300-for-each-ref.sh b/t/t6300-for-each-ref.sh index ad9620efeb..05a15a933a 100755 --- a/t/t6300-for-each-ref.sh +++ b/t/t6300-for-each-ref.sh @@ -66,7 +66,9 @@ test_atom() { case $type in tag) # We cannot use $3 as it expects sanitize_pgp to run - expect=$(git cat-file tag $ref | tail -n +6 | wc -c) ;; + git cat-file tag $ref >out && + expect=$(tail -n +6 out | wc -c) && + rm -f out ;; tree | blob) expect="" ;; commit) |