t6300: avoid hard-coding object sizes
commitfbc6526ea651565889e437ce7b12c762ef858813
authorRené Scharfe <l.s.r@web.de>
Tue, 12 Dec 2023 17:04:55 +0000 (12 18:04 +0100)
committerJunio C Hamano <gitster@pobox.com>
Tue, 12 Dec 2023 23:41:15 +0000 (12 15:41 -0800)
tree595d516cb07c86cfe4c56804fae5ad14f4326086
parent564d0252ca632e0264ed670534a51d18a689ef5d
t6300: avoid hard-coding object sizes

f4ee22b526 (ref-filter: add tests for objectsize:disk, 2018-12-24)
hard-coded the expected object sizes.  Coincidentally the size of commit
and tag is the same with zlib at the default compression level.

1f5f8f3e85 (t6300: abstract away SHA-1-specific constants, 2020-02-22)
encoded the sizes as a single value, which coincidentally also works
with sha256.

Different compression libraries like zlib-ng may arrive at different
values.  Get them from the file system instead of hard-coding them to
make switching the compression library (or changing the compression
level) easier.

Reported-by: Ondrej Pohorelsky <opohorel@redhat.com>
Signed-off-by: René Scharfe <l.s.r@web.de>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
t/t6300-for-each-ref.sh