diff --git a/t/t1006-cat-file.sh b/t/t1006-cat-file.sh index 21915be308fbdf..e0c6482797e120 100755 --- a/t/t1006-cat-file.sh +++ b/t/t1006-cat-file.sh @@ -1117,14 +1117,16 @@ test_expect_success 'cat-file %(objectsize:disk) with --batch-all-objects' ' while read idx do git show-index <"$idx" >idx.raw && - sort -n idx.sorted && + sort -nr idx.sorted && packsz=$(test_file_size "${idx%.idx}.pack") && end=$((packsz - rawsz)) && - awk -v end="$end" " - NR > 1 { print oid, \$1 - start } - { start = \$1; oid = \$2 } - END { print oid, end - start } - " idx.sorted || + while read start oid rest + do + size=$((end - start)) && + end=$start && + echo "$oid $size" || + return 1 + done expect.raw &&