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 <stolee@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Derrick Stolee committed
Sep 20, 2024 at 00:00 UTC
b9183b0a02c59d86b6d9e4e0da996c8909ed6fa8
2 files changed
+8
-2
scalar.c
+3
@@ -723,6 +723,9 @@ static int cmd_reconfigure(int argc, const char **argv)
723
724
the_repository = old_repo;
725
726
+ if (toggle_maintenance(1) >= 0)
727
+ succeeded = 1;
728
+
729
loop_end:
730
if (!succeeded) {
731
res = -1;
t/t9210-scalar.sh
+5
-2
@@ -176,8 +176,11 @@ test_expect_success 'scalar reconfigure' '
176
scalar reconfigure one &&
177
test true = "$(git -C one/src config core.preloadIndex)" &&
178
git -C one/src config core.preloadIndex false &&
179
- scalar reconfigure -a &&
180
- test true = "$(git -C one/src config core.preloadIndex)"
179
+ rm one/src/cron.txt &&
180
+ GIT_TRACE2_EVENT="$(pwd)/reconfigure" scalar reconfigure -a &&
181
+ test_path_is_file one/src/cron.txt &&
182
+ test true = "$(git -C one/src config core.preloadIndex)" &&
183
+ test_subcommand git maintenance start <reconfigure
184
'
185
186
test_expect_success 'scalar reconfigure --all with includeIf.onbranch' '