File tree Expand file tree Collapse file tree 3 files changed +20
-5
lines changed Expand file tree Collapse file tree 3 files changed +20
-5
lines changed Original file line number Diff line number Diff line change @@ -101,7 +101,7 @@ This is done to avoid disrupting the remote-tracking branches. The end users
101
101
expect these refs to stay unmoved unless they initiate a fetch. With prefetch
102
102
task, however, the objects necessary to complete a later real fetch would
103
103
already be obtained, so the real fetch would go faster. In the ideal case,
104
- it will just become an update to bunch of remote-tracking branches without
104
+ it will just become an update to a bunch of remote-tracking branches without
105
105
any object transfer.
106
106
107
107
gc::
Original file line number Diff line number Diff line change @@ -1554,11 +1554,10 @@ static int update_background_schedule(int run_maintenance)
1554
1554
while (!strbuf_getline_lf (& line , cron_list )) {
1555
1555
if (!in_old_region && !strcmp (line .buf , BEGIN_LINE ))
1556
1556
in_old_region = 1 ;
1557
- if (in_old_region )
1558
- continue ;
1559
- fprintf (cron_in , "%s\n" , line .buf );
1560
- if (in_old_region && !strcmp (line .buf , END_LINE ))
1557
+ else if (in_old_region && !strcmp (line .buf , END_LINE ))
1561
1558
in_old_region = 0 ;
1559
+ else if (!in_old_region )
1560
+ fprintf (cron_in , "%s\n" , line .buf );
1562
1561
}
1563
1562
1564
1563
if (run_maintenance ) {
Original file line number Diff line number Diff line change @@ -446,6 +446,22 @@ test_expect_success 'start preserves existing schedule' '
446
446
grep "Important information!" cron.txt
447
447
'
448
448
449
+ test_expect_success ' magic markers are correct' '
450
+ grep "GIT MAINTENANCE SCHEDULE" cron.txt >actual &&
451
+ cat >expect <<-\EOF &&
452
+ # BEGIN GIT MAINTENANCE SCHEDULE
453
+ # END GIT MAINTENANCE SCHEDULE
454
+ EOF
455
+ test_cmp actual expect
456
+ '
457
+
458
+ test_expect_success ' stop preserves surrounding schedule' '
459
+ echo "Crucial information!" >>cron.txt &&
460
+ GIT_TEST_CRONTAB="test-tool crontab cron.txt" git maintenance stop &&
461
+ grep "Important information!" cron.txt &&
462
+ grep "Crucial information!" cron.txt
463
+ '
464
+
449
465
test_expect_success ' register preserves existing strategy' '
450
466
git config maintenance.strategy none &&
451
467
git maintenance register &&
You can’t perform that action at this time.
0 commit comments