]> git.ipfire.org Git - thirdparty/git.git/commitdiff
scalar: configure maintenance during 'reconfigure'
authorDerrick Stolee <derrickstolee@github.com>
Fri, 20 Sep 2024 00:00:23 +0000 (00:00 +0000)
committerJunio C Hamano <gitster@pobox.com>
Fri, 20 Sep 2024 21:44:32 +0000 (14:44 -0700)
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>
scalar.c
t/t9210-scalar.sh

index 1fe8a93e6529a25679e506fdc18864f72a3905b2..62352e3d67864be182e316af1bc2d8f40767c042 100644 (file)
--- a/scalar.c
+++ b/scalar.c
@@ -723,6 +723,9 @@ static int cmd_reconfigure(int argc, const char **argv)
 
                the_repository = old_repo;
 
+               if (toggle_maintenance(1) >= 0)
+                       succeeded = 1;
+
 loop_end:
                if (!succeeded) {
                        res = -1;
index a41b4fcc0859db4d40137ce768a528c237975456..67fc01e331f4f7055914025b3e3d88922e55ce88 100755 (executable)
@@ -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 <reconfigure
 '
 
 test_expect_success 'scalar reconfigure --all with includeIf.onbranch' '