summaryrefslogtreecommitdiff
path: root/t/t7900-maintenance.sh
diff options
context:
space:
mode:
authorDerrick Stolee <dstolee@microsoft.com>2020-08-28 15:45:12 +0000
committerJunio C Hamano <gitster@pobox.com>2020-09-25 10:59:44 -0700
commit1942d48380fec53f76361e9adebef15b5db9628a (patch)
tree22f3cce07f538def0328d09ddf15e283ec1ada76 /t/t7900-maintenance.sh
parente841a79a131d8ce491cf04d0ca3e24f139a10b82 (diff)
downloadgit-1942d48380fec53f76361e9adebef15b5db9628a.tar.gz
maintenance: optionally skip --auto process
Some commands run 'git maintenance run --auto --[no-]quiet' after doing their normal work, as a way to keep repositories clean as they are used. Currently, users who do not want this maintenance to occur would set the 'gc.auto' config option to 0 to avoid the 'gc' task from running. However, this does not stop the extra process invocation. On Windows, this extra process invocation can be more expensive than necessary. Allow users to drop this extra process by setting 'maintenance.auto' to 'false'. Signed-off-by: Derrick Stolee <dstolee@microsoft.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 't/t7900-maintenance.sh')
-rwxr-xr-xt/t7900-maintenance.sh13
1 files changed, 13 insertions, 0 deletions
diff --git a/t/t7900-maintenance.sh b/t/t7900-maintenance.sh
index 55116c2f04..c7caaa7a55 100755
--- a/t/t7900-maintenance.sh
+++ b/t/t7900-maintenance.sh
@@ -28,6 +28,19 @@ test_expect_success 'run [--auto|--quiet]' '
test_subcommand git gc --no-quiet <run-no-quiet.txt
'
+test_expect_success 'maintenance.auto config option' '
+ GIT_TRACE2_EVENT="$(pwd)/default" git commit --quiet --allow-empty -m 1 &&
+ test_subcommand git maintenance run --auto --quiet <default &&
+ GIT_TRACE2_EVENT="$(pwd)/true" \
+ git -c maintenance.auto=true \
+ commit --quiet --allow-empty -m 2 &&
+ test_subcommand git maintenance run --auto --quiet <true &&
+ GIT_TRACE2_EVENT="$(pwd)/false" \
+ git -c maintenance.auto=false \
+ commit --quiet --allow-empty -m 3 &&
+ test_subcommand ! git maintenance run --auto --quiet <false
+'
+
test_expect_success 'maintenance.<task>.enabled' '
git config maintenance.gc.enabled false &&
git config maintenance.commit-graph.enabled true &&