]> git.ipfire.org Git - thirdparty/git.git/commitdiff
t7900-maintenance: test for magic markers
authorMartin Ågren <martin.agren@gmail.com>
Mon, 21 Dec 2020 21:26:33 +0000 (22:26 +0100)
committerJunio C Hamano <gitster@pobox.com>
Mon, 21 Dec 2020 22:33:09 +0000 (14:33 -0800)
When we insert our "BEGIN" and "END" markers into the cron table, it's
so that a Git version from many years into the future would be able to
identify this region in the cron table. Let's add a test to make sure
that these markers don't ever change.

Signed-off-by: Martin Ågren <martin.agren@gmail.com>
Acked-by: Derrick Stolee <dstolee@microsoft.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
t/t7900-maintenance.sh

index 4bbfce31e95e80d50de638beb9605dffa9cdc630..99bf0c7582b3a07ab20cd5cde864058605e48ac4 100755 (executable)
@@ -446,6 +446,15 @@ test_expect_success 'start preserves existing schedule' '
        grep "Important information!" cron.txt
 '
 
+test_expect_success 'magic markers are correct' '
+       grep "GIT MAINTENANCE SCHEDULE" cron.txt >actual &&
+       cat >expect <<-\EOF &&
+       # BEGIN GIT MAINTENANCE SCHEDULE
+       # END GIT MAINTENANCE SCHEDULE
+       EOF
+       test_cmp actual expect
+'
+
 test_expect_success 'stop preserves surrounding schedule' '
        echo "Crucial information!" >>cron.txt &&
        GIT_TEST_CRONTAB="test-tool crontab cron.txt" git maintenance stop &&