From f664318b331a3facf5c53359e50894ac78b4ebc1 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, 7 insertions(+), 3 deletions(-) diff --git a/scalar.c b/scalar.c index 65129d6ff05898..3328478dcc853f 100644 --- a/scalar.c +++ b/scalar.c @@ -1101,7 +1101,8 @@ static int cmd_reconfigure(int argc, const char **argv) old_repo = the_repository; the_repository = &r; - if (set_recommended_config(1) >= 0) + if (set_recommended_config(1) >= 0 && + toggle_maintenance(1) >= 0) succeeded = 1; the_repository = old_repo; diff --git a/t/t9210-scalar.sh b/t/t9210-scalar.sh index f41694ea315680..2c3445a91ba1a1 100755 --- a/t/t9210-scalar.sh +++ b/t/t9210-scalar.sh @@ -183,8 +183,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