diff --git a/cmd/git-run.go b/cmd/git-run.go index bf5cb16..22aacee 100644 --- a/cmd/git-run.go +++ b/cmd/git-run.go @@ -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): diff --git a/cmd/git.go b/cmd/git.go index 22e586f..968248f 100644 --- a/cmd/git.go +++ b/cmd/git.go @@ -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) { @@ -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