aboutsummaryrefslogtreecommitdiff
path: root/t
diff options
context:
space:
mode:
authorJustin Tobler <jltobler@gmail.com>2025-12-17 11:54:02 -0600
committerJunio C Hamano <gitster@pobox.com>2025-12-18 09:02:31 +0900
commit4d279ae36b1d0f68c8a7ba9b986ff9690ddc1af9 (patch)
treee8365afdff4ad0ca9820c53df26b1723809770da /t
parent3e114496e48e665d2bb9e0c0917e6051d60392ea (diff)
downloadgit-4d279ae36b1d0f68c8a7ba9b986ff9690ddc1af9.tar.xz
builtin/repo: add inflated object info to structure table
Update the table output format for the git-repo(1) structure command to begin printing the total inflated object size info by object type. To be more human-friendly, larger values are scaled down and displayed with the appropriate unit prefix. Output for the keyvalue and nul formats remains unchanged. Signed-off-by: Justin Tobler <jltobler@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 't')
-rwxr-xr-xt/t1901-repo-structure.sh62
1 files changed, 36 insertions, 26 deletions
diff --git a/t/t1901-repo-structure.sh b/t/t1901-repo-structure.sh
index 33237822fd..b18213c660 100755
--- a/t/t1901-repo-structure.sh
+++ b/t/t1901-repo-structure.sh
@@ -13,18 +13,23 @@ test_expect_success 'empty repository' '
| Repository structure | Value |
| -------------------- | ------ |
| * References | |
- | * Count | 0 |
- | * Branches | 0 |
- | * Tags | 0 |
- | * Remotes | 0 |
- | * Others | 0 |
+ | * Count | 0 |
+ | * Branches | 0 |
+ | * Tags | 0 |
+ | * Remotes | 0 |
+ | * Others | 0 |
| | |
| * Reachable objects | |
- | * Count | 0 |
- | * Commits | 0 |
- | * Trees | 0 |
- | * Blobs | 0 |
- | * Tags | 0 |
+ | * Count | 0 |
+ | * Commits | 0 |
+ | * Trees | 0 |
+ | * Blobs | 0 |
+ | * Tags | 0 |
+ | * Inflated size | 0 B |
+ | * Commits | 0 B |
+ | * Trees | 0 B |
+ | * Blobs | 0 B |
+ | * Tags | 0 B |
EOF
git repo structure >out 2>err &&
@@ -34,7 +39,7 @@ test_expect_success 'empty repository' '
)
'
-test_expect_success 'repository with references and objects' '
+test_expect_success SHA1 'repository with references and objects' '
test_when_finished "rm -rf repo" &&
git init repo &&
(
@@ -49,21 +54,26 @@ test_expect_success 'repository with references and objects' '
git notes add -m foo &&
cat >expect <<-\EOF &&
- | Repository structure | Value |
- | -------------------- | ------ |
- | * References | |
- | * Count | 4 |
- | * Branches | 1 |
- | * Tags | 1 |
- | * Remotes | 1 |
- | * Others | 1 |
- | | |
- | * Reachable objects | |
- | * Count | 3.02 k |
- | * Commits | 1.01 k |
- | * Trees | 1.01 k |
- | * Blobs | 1.01 k |
- | * Tags | 1 |
+ | Repository structure | Value |
+ | -------------------- | ---------- |
+ | * References | |
+ | * Count | 4 |
+ | * Branches | 1 |
+ | * Tags | 1 |
+ | * Remotes | 1 |
+ | * Others | 1 |
+ | | |
+ | * Reachable objects | |
+ | * Count | 3.02 k |
+ | * Commits | 1.01 k |
+ | * Trees | 1.01 k |
+ | * Blobs | 1.01 k |
+ | * Tags | 1 |
+ | * Inflated size | 16.03 MiB |
+ | * Commits | 217.92 KiB |
+ | * Trees | 15.81 MiB |
+ | * Blobs | 11.68 KiB |
+ | * Tags | 132 B |
EOF
git repo structure >out 2>err &&