From: Đoàn Trần Công Danh Date: Sat, 21 Aug 2021 01:36:34 +0000 (+0700) Subject: t6300: check for cat-file exit status code X-Git-Tag: v2.33.1~60^2 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=1549577338c7c3a4455e9b3f05f9c8740b8e5337;p=thirdparty%2Fgit.git 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 Signed-off-by: Junio C Hamano --- 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)