From: Patrick Steinhardt Date: Mon, 15 Dec 2025 05:33:32 GMT Subject: Re: [PATCH v2 6/7] builtin/repo: add disk size info to keyvalue stucture output Message-ID: In-Reply-To: <20251212223644.3090879-7-jltobler@gmail.com> On Fri, Dec 12, 2025 at 04:36:43PM -0600, Justin Tobler wrote: > diff --git a/t/t1901-repo-structure.sh b/t/t1901-repo-structure.sh > index b18213c660..1553f3cd32 100755 > --- a/t/t1901-repo-structure.sh > +++ b/t/t1901-repo-structure.sh > @@ -4,6 +4,11 @@ test_description='test git repo structure' > > . ./test-lib.sh > > +object_type_disk_usage() { > + git cat-file --batch-check='%(objectsize:disk)' --batch-all-objects \ > + --filter=object:type=$1 | awk '{ sum += $1 } END { print sum }' > +} > + Using `git rev-list --all --disk-usage --filter=object:type=$1 --filter-provided-objects` would avoid the separate call to awk(1). Patrick