Skip to content

Commit

Permalink
scalar: configure maintenance during 'reconfigure'
Browse files Browse the repository at this point in the history
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 <derrickstolee@github.com>
  • Loading branch information
derrickstolee authored and dscho committed Apr 23, 2024
1 parent 65e5c83 commit b5a6d03
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 2 deletions.
3 changes: 3 additions & 0 deletions scalar.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
7 changes: 5 additions & 2 deletions t/t9210-scalar.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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 <reconfigure
'

test_expect_success '`reconfigure -a` removes stale config entries' '
Expand Down

0 comments on commit b5a6d03

Please sign in to comment.