@@ -384,7 +384,7 @@ func main() {
384384 "sync on receipt of the specified signal (e.g. SIGHUP)" )
385385 flMaxFailures := pflag .Int ("max-failures" ,
386386 envInt (0 , "GITSYNC_MAX_FAILURES" , "GIT_SYNC_MAX_FAILURES" ),
387- "the number of consecutive failures allowed before aborting (the first sync must succeed, -1 will retry forever" )
387+ "the number of consecutive failures allowed before aborting (-1 will retry forever" )
388388 flTouchFile := pflag .String ("touch-file" ,
389389 envString ("" , "GITSYNC_TOUCH_FILE" , "GIT_SYNC_TOUCH_FILE" ),
390390 "the path (absolute or relative to --root) to an optional file which will be touched whenever a sync completes (defaults to disabled)" )
@@ -964,7 +964,7 @@ func main() {
964964 if changed , hash , err := git .SyncRepo (ctx , refreshCreds ); err != nil {
965965 failCount ++
966966 updateSyncMetrics (metricKeyError , start )
967- if * flMaxFailures >= 0 && failCount > * flMaxFailures {
967+ if * flMaxFailures >= 0 && failCount >= * flMaxFailures {
968968 // Exit after too many retries, maybe the error is not recoverable.
969969 log .Error (err , "too many failures, aborting" , "failCount" , failCount )
970970 os .Exit (1 )
@@ -2375,10 +2375,10 @@ OPTIONS
23752375 Print this manual and exit.
23762376
23772377 --max-failures <int>, $GITSYNC_MAX_FAILURES
2378- The number of consecutive failures allowed before aborting (the
2379- first sync must succeed), Setting this to a negative value will
2380- retry forever after the initial sync. If not specified, this
2381- defaults to 0, meaning any sync failure will terminate git-sync.
2378+ The number of consecutive failures allowed before aborting.
2379+ Setting this to a negative value will retry forever. If not
2380+ specified, this defaults to 0, meaning any sync failure will
2381+ terminate git-sync.
23822382
23832383 --one-time, $GITSYNC_ONE_TIME
23842384 Exit after one sync.
0 commit comments