Skip to content

Commit

Permalink
feat: skip on reference not found
Browse files Browse the repository at this point in the history
  • Loading branch information
zbiljic committed Jan 1, 2024
1 parent a2e7663 commit 2e5b7fb
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
2 changes: 2 additions & 0 deletions cmd/git-run.go
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,8 @@ func gitRunUpdate(ctx context.Context, repoPath string) error {
switch {
case errors.Is(err, git.NoErrAlreadyUpToDate):
fallthrough
case errors.Is(err, ErrGitMissingRemoteHeadReference):
fallthrough
case errors.Is(err, ErrGitRepositoryNotReachable):
fallthrough
case errors.Is(err, ErrGitRepositoryDisabled):
Expand Down
4 changes: 2 additions & 2 deletions cmd/git.go
Original file line number Diff line number Diff line change
Expand Up @@ -428,7 +428,7 @@ func gitUpdateDefaultBranch(ctx context.Context, repoPath string) error {

if errors.Is(err, ErrGitMissingRemoteHeadReference) {
prefixPrinter.WithMessageStyle(&pterm.ThemeDefault.ErrorMessageStyle).Println(err.Error())
return nil
return err
}

if errors.Is(err, ErrGitRepositoryNotReachable) {
Expand Down Expand Up @@ -808,7 +808,7 @@ func gitCheckAndPull(ctx context.Context, repoPath string) error {
// retry
case errors.Is(err, plumbing.ErrReferenceNotFound):
if err1 := gitUpdateDefaultBranch(ctx, repoPath); err1 != nil {
return err
return err1
}
// NOTE: skip backoff, fast retry
continue
Expand Down

0 comments on commit 2e5b7fb

Please sign in to comment.