From a3fdbddfc0752f820ed1e77583cf736bfbef8f68 Mon Sep 17 00:00:00 2001 From: Sam Catlow Date: Mon, 9 Nov 2026 14:37:17 +1100 Subject: [PATCH] fix(worktree): match object-not-found by message too, as push transports may flatten it (#1843) --- internal/worktree/worktree.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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)