Re: [PATCH v2 6/7] builtin/repo: add disk size info to keyvalue stucture output
- From
Patrick Steinhardt <ps@pks.im>
- Date
- Dec 15, 2025, 05:33 UTC
- Message-ID
- <aT-drLh5WBX3vMLU@pks.im>
- In-Reply-To
- <20251212223644.3090879-7-jltobler@gmail.com>
On Fri, Dec 12, 2025 at 04:36:43PM -0600, Justin Tobler wrote:
Show 13 quoted lines
> 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