Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 3 additions & 2 deletions internal/strategy/git/backend.go
Original file line number Diff line number Diff line change
Expand Up @@ -153,6 +153,7 @@ func (s *Strategy) ensureRefsUpToDate(ctx context.Context, c *clone) error {
return nil
}
c.lastRefCheck = time.Now()
c.refCheckValid = true
c.mu.Unlock()

logger.DebugContext(ctx, "Checking upstream for new refs",
Expand Down Expand Up @@ -199,9 +200,9 @@ func (s *Strategy) ensureRefsUpToDate(ctx context.Context, c *clone) error {

logger.InfoContext(ctx, "Upstream has new or updated refs, fetching")
err = s.executeFetch(ctx, c)
if err == nil {
if err != nil {
c.mu.Lock()
c.refCheckValid = true
c.refCheckValid = false
c.mu.Unlock()
}
return err
Expand Down