diff --git a/internal/worktree/worktree.go b/internal/worktree/worktree.go index cbd27e411..220ff7f04 100644 --- a/internal/worktree/worktree.go +++ b/internal/worktree/worktree.go @@ -717,7 +717,7 @@ func (m *Manager) push(ctx context.Context, dir, branch, remoteURL string) error }) } err = publish() - if errors.Is(err, plumbing.ErrObjectNotFound) { + if errors.Is(err, plumbing.ErrObjectNotFound) || strings.Contains(err.Error(), plumbing.ErrObjectNotFound.Error()) { // The clone borrows objects from the shared mirror; a damaged mirror // loses them. The forge still has every base object, so rebuild it. m.logger().WarnContext(ctx, "push hit a missing object, rebuilding the mirror", "branch", branch, "err", err)