Subject: Re: [PATCH v2 6/7] builtin/repo: add disk size info to keyvalue stucture output

From: Patrick Steinhardt <[email-masked]>
Date: Mon, 15 Dec 2025 06:33:32 +0100

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