diff options
author | Martin Ågren <martin.agren@gmail.com> | 2020-12-21 22:26:32 +0100 |
---|---|---|
committer | Junio C Hamano <gitster@pobox.com> | 2020-12-21 14:33:08 -0800 |
commit | 66dc0a3625e9f3ea8e99e5ae4f4d3dded1d5c8c6 (patch) | |
tree | dabc3187398ce3c802206728905c61d589028f15 /diff.h | |
parent | git-maintenance.txt: add missing word (diff) | |
download | tgif-66dc0a3625e9f3ea8e99e5ae4f4d3dded1d5c8c6.tar.xz |
gc: fix handling of crontab magic markers
On `git maintenance start`, we add a few entries to the user's cron
table. We wrap our entries using two magic markers, "# BEGIN GIT
MAINTENANCE SCHEDULE" and "# END GIT MAINTENANCE SCHEDULE". At a later
`git maintenance stop`, we will go through the table and remove these
lines. Or rather, we will remove the "BEGIN" marker, the "END" marker
and everything between them.
Alas, we have a bug in how we detect the "END" marker: we don't. As we
loop through all the lines of the crontab, if we are in the "old
region", i.e., the region we're aiming to remove, we make an early
`continue` and don't get as far as checking for the "END" marker. Thus,
once we've seen our "BEGIN", we remove everything until the end of the
file.
Rewrite the logic for identifying these markers. There are four cases
that are mutually exclusive: The current line starts a region or it ends
it, or it's firmly within the region, or it's outside of it (and should
be printed).
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>
Diffstat (limited to 'diff.h')
0 files changed, 0 insertions, 0 deletions