diff options
| author | Patrick Steinhardt <ps@pks.im> | 2025-10-24 08:57:18 +0200 |
|---|---|---|
| committer | Junio C Hamano <gitster@pobox.com> | 2025-10-24 13:42:43 -0700 |
| commit | d465be2327d934f3506d412cc4f4067baba0d1c5 (patch) | |
| tree | a60816a2521d9b75cd3652d49857113a058633e8 /t | |
| parent | builtin/maintenance: make the geometric factor configurable (diff) | |
| download | git-d465be2327d934f3506d412cc4f4067baba0d1c5.tar.gz git-d465be2327d934f3506d412cc4f4067baba0d1c5.zip | |
builtin/maintenance: don't silently ignore invalid strategy
When parsing maintenance strategies we completely ignore the
user-configured value in case it is unknown to us. This makes it
basically undiscoverable to the user that scheduled maintenance is
devolving into a no-op.
Change this to instead die when seeing an unknown maintenance strategy.
While at it, pull out the parsing logic into a separate function so that
we can reuse it in a subsequent commit.
Signed-off-by: Patrick Steinhardt <ps@pks.im>
Acked-by: Taylor Blau <me@ttaylorr.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 't')
| -rwxr-xr-x | t/t7900-maintenance.sh | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/t/t7900-maintenance.sh b/t/t7900-maintenance.sh index e0352fd196..0fb917dd7b 100755 --- a/t/t7900-maintenance.sh +++ b/t/t7900-maintenance.sh @@ -1263,6 +1263,11 @@ test_expect_success 'fails when running outside of a repository' ' nongit test_must_fail git maintenance unregister ' +test_expect_success 'fails when configured to use an invalid strategy' ' + test_must_fail git -c maintenance.strategy=invalid maintenance run --schedule=hourly 2>err && + test_grep "unknown maintenance strategy: .invalid." err +' + test_expect_success 'register and unregister bare repo' ' test_when_finished "git config --global --unset-all maintenance.repo || :" && test_might_fail git config --global --unset-all maintenance.repo && |
