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 committed Aug 23, 2023
1 parent 384c80e commit c68e5fb
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 @@ -1100,6 +1100,9 @@ static int cmd_reconfigure(int argc, const char **argv)
if (set_recommended_config(1) < 0)
failed = -1;

if (toggle_maintenance(1) < 0)
failed = -1;

loop_end:
if (failed) {
res = failed;
Expand Down
7 changes: 5 additions & 2 deletions t/t9210-scalar.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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 '`reconfigure -a` removes stale config entries' '
Expand Down

0 comments on commit c68e5fb

Please sign in to comment.