summaryrefslogtreecommitdiffstats
path: root/t/t7900-maintenance.sh
diff options
context:
space:
mode:
authorPatrick Steinhardt <ps@pks.im>2024-08-19 09:48:05 +0200
committerJunio C Hamano <gitster@pobox.com>2024-08-21 20:33:22 +0200
commit8311e3b5515ea161c74cfd9b032270c0f459f2b8 (patch)
treeaeedba65744a87d56a9a0ae53c7e2603f8015e57 /t/t7900-maintenance.sh
parentt7900: exercise detaching via trace2 regions (diff)
downloadgit-8311e3b5515ea161c74cfd9b032270c0f459f2b8.tar.xz
git-8311e3b5515ea161c74cfd9b032270c0f459f2b8.zip
builtin/maintenance: fix loose objects task emitting pack hash
The "loose-objects" maintenance tasks executes git-pack-objects(1) to pack all loose objects into a new packfile. This command ends up printing the hash of the packfile to stdout though, which clutters the output of `git maintenance run`. Fix this issue by disabling stdout of the child process. Signed-off-by: Patrick Steinhardt <ps@pks.im> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to '')
-rwxr-xr-xt/t7900-maintenance.sh16
1 files changed, 16 insertions, 0 deletions
diff --git a/t/t7900-maintenance.sh b/t/t7900-maintenance.sh
index 18e0bb29d7..abae7a9754 100755
--- a/t/t7900-maintenance.sh
+++ b/t/t7900-maintenance.sh
@@ -975,4 +975,20 @@ test_expect_success '--detach causes maintenance to run in background' '
)
'
+test_expect_success 'repacking loose objects is quiet' '
+ test_when_finished "rm -rf repo" &&
+ git init repo &&
+ (
+ cd repo &&
+
+ test_commit something &&
+ git config set maintenance.gc.enabled false &&
+ git config set maintenance.loose-objects.enabled true &&
+ git config set maintenance.loose-objects.auto 1 &&
+
+ git maintenance run --quiet >out 2>&1 &&
+ test_must_be_empty out
+ )
+'
+
test_done