summaryrefslogtreecommitdiff
path: root/builtin
diff options
context:
space:
mode:
authorLibravatar Junio C Hamano <gitster@pobox.com>2020-12-23 13:59:46 -0800
committerLibravatar Junio C Hamano <gitster@pobox.com>2020-12-23 13:59:46 -0800
commit7a5026529529e811b41de02ca12aa6c8ff3d11c5 (patch)
treec21a12770bad4b904073dab1a93c152e609d95e2 /builtin
parentMerge branch 'dl/checkout-p-merge-base' (diff)
parentt7900-maintenance: test for magic markers (diff)
downloadtgif-7a5026529529e811b41de02ca12aa6c8ff3d11c5.tar.xz
Merge branch 'ma/maintenance-crontab-fix'
Hotfix for a topic of this cycle. * ma/maintenance-crontab-fix: t7900-maintenance: test for magic markers gc: fix handling of crontab magic markers git-maintenance.txt: add missing word
Diffstat (limited to 'builtin')
-rw-r--r--builtin/gc.c7
1 files changed, 3 insertions, 4 deletions
diff --git a/builtin/gc.c b/builtin/gc.c
index b57fda4924..4c24f41852 100644
--- a/builtin/gc.c
+++ b/builtin/gc.c
@@ -1554,11 +1554,10 @@ static int update_background_schedule(int run_maintenance)
while (!strbuf_getline_lf(&line, cron_list)) {
if (!in_old_region && !strcmp(line.buf, BEGIN_LINE))
in_old_region = 1;
- if (in_old_region)
- continue;
- fprintf(cron_in, "%s\n", line.buf);
- if (in_old_region && !strcmp(line.buf, END_LINE))
+ else if (in_old_region && !strcmp(line.buf, END_LINE))
in_old_region = 0;
+ else if (!in_old_region)
+ fprintf(cron_in, "%s\n", line.buf);
}
if (run_maintenance) {