Skip to content

Commit

Permalink
Merge branch 'jk/t1006-cat-file-objectsize-disk' into next
Browse files Browse the repository at this point in the history
Test update.

* jk/t1006-cat-file-objectsize-disk:
  t1006: prefer shell loop to awk for packed object sizes
  • Loading branch information
gitster committed Jan 3, 2024
2 parents 074686e + 54d8a25 commit a492c63
Showing 1 changed file with 8 additions and 6 deletions.
14 changes: 8 additions & 6 deletions t/t1006-cat-file.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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 &&
Expand Down

0 comments on commit a492c63

Please sign in to comment.