From f1896c9f5e02117857888397b116506bd3050767 Mon Sep 17 00:00:00 2001 From: Derrick Stolee Date: Mon, 21 Aug 2023 11:14:48 -0400 Subject: [PATCH] scalar: configure maintenance during 'reconfigure' The 'scalar reconfigure' command is intended to update registered repos with the latest settings available. However, up to now we were not reregistering the repos with background maintenance. In particular, this meant that the background maintenance schedule would not be updated if there are improvements between versions. Be sure to register repos for maintenance during the reconfigure step. Signed-off-by: Derrick Stolee --- scalar.c | 3 +++ t/t9210-scalar.sh | 7 +++++-- 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/scalar.c b/scalar.c index bfc41aec1897e0..5b6ae5b9a59c61 100644 --- a/scalar.c +++ b/scalar.c @@ -1102,6 +1102,9 @@ static int cmd_reconfigure(int argc, const char **argv) if (set_recommended_config(1) >= 0) succeeded = 1; + if (toggle_maintenance(1) >= 0) + succeeded = 1; + loop_end: if (!succeeded) { res = -1; diff --git a/t/t9210-scalar.sh b/t/t9210-scalar.sh index bff32aed8a2950..a2ddc4f3187bef 100755 --- a/t/t9210-scalar.sh +++ b/t/t9210-scalar.sh @@ -176,8 +176,11 @@ test_expect_success 'scalar reconfigure' ' scalar reconfigure one && test true = "$(git -C one/src config core.preloadIndex)" && git -C one/src config core.preloadIndex false && - scalar reconfigure -a && - test true = "$(git -C one/src config core.preloadIndex)" + rm one/src/cron.txt && + GIT_TRACE2_EVENT="$(pwd)/reconfigure" scalar reconfigure -a && + test_path_is_file one/src/cron.txt && + test true = "$(git -C one/src config core.preloadIndex)" && + test_subcommand git maintenance start