summaryrefslogtreecommitdiff
path: root/t
diff options
context:
space:
mode:
authorJunio C Hamano <gitster@pobox.com>2024-11-20 14:42:57 +0900
committerJunio C Hamano <gitster@pobox.com>2024-11-20 14:42:58 +0900
commit76c1953395770e5334a506eb59bc19ff4cd99e6c (patch)
tree328c09fa5f045866135902d4509ad9b729765d53 /t
parentf1a50f12b94701a3a1103f51f4ef31ee7e413743 (diff)
parentc95547a394a35dc26afa686454086d2db6e51ea4 (diff)
Merge branch 'ps/maintenance-start-crash-fix' into maint-2.47
"git maintenance start" crashed due to an uninitialized variable reference, which has been corrected. * ps/maintenance-start-crash-fix: builtin/gc: fix crash when running `git maintenance start`
Diffstat (limited to 't')
-rwxr-xr-xt/t7900-maintenance.sh16
1 files changed, 16 insertions, 0 deletions
diff --git a/t/t7900-maintenance.sh b/t/t7900-maintenance.sh
index a66d0e089d..c224c8450c 100755
--- a/t/t7900-maintenance.sh
+++ b/t/t7900-maintenance.sh
@@ -646,6 +646,22 @@ test_expect_success !MINGW 'register and unregister with regex metacharacters' '
maintenance.repo "$(pwd)/$META"
'
+test_expect_success 'start without GIT_TEST_MAINT_SCHEDULER' '
+ test_when_finished "rm -rf systemctl.log script repo" &&
+ mkdir script &&
+ write_script script/systemctl <<-\EOF &&
+ echo "$*" >>../systemctl.log
+ EOF
+ git init repo &&
+ (
+ cd repo &&
+ sane_unset GIT_TEST_MAINT_SCHEDULER &&
+ PATH="$PWD/../script:$PATH" git maintenance start --scheduler=systemd
+ ) &&
+ test_grep -- "--user list-timers" systemctl.log &&
+ test_grep -- "enable --now git-maintenance@" systemctl.log
+'
+
test_expect_success 'start --scheduler=<scheduler>' '
test_expect_code 129 git maintenance start --scheduler=foo 2>err &&
test_grep "unrecognized --scheduler argument" err &&