scalar: only warn when background maintenance fails
commitdea63088928cde2fd264a852a9b14c05178e0838
authorDerrick Stolee <derrickstolee@github.com>
Fri, 27 Jan 2023 20:06:03 +0000 (27 20:06 +0000)
committerJunio C Hamano <gitster@pobox.com>
Fri, 27 Jan 2023 20:38:26 +0000 (27 12:38 -0800)
tree40ba5f067191ccd6a520732eadde01a9fbf15209
parenteeea9ae1657e32ee16f8452ff201b2ca54d51641
scalar: only warn when background maintenance fails

A user reported issues with 'scalar clone' and 'scalar register' when
working in an environment that had locked down the ability to run
'crontab' or 'systemctl' in that those commands registered as _failures_
instead of opportunistically reporting a success with just a warning
about background maintenance.

As a workaround, they can use GIT_TEST_MAINT_SCHEDULER to fake a
successful background maintenance, but this is not a viable strategy for
long-term.

Update 'scalar register' and 'scalar clone' to no longer fail by
modifying register_dir() to only warn when toggle_maintenance(1) fails.

Since background maintenance is a "nice to have" and not a requirement
for a working repository, it is best to move this from hard error to
gentle warning.

Signed-off-by: Derrick Stolee <derrickstolee@github.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
scalar.c
t/t9210-scalar.sh
t/t9211-scalar-clone.sh