diff options
Diffstat (limited to 't/t1006-cat-file.sh')
-rwxr-xr-x | t/t1006-cat-file.sh | 14 |
1 files changed, 8 insertions, 6 deletions
diff --git a/t/t1006-cat-file.sh b/t/t1006-cat-file.sh index 0c2eafae65..5ea3326128 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.raw >idx.sorted && + sort -nr <idx.raw >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 <idx.sorted || return 1 done } >expect.raw && |