fix(worktree): object-not-found match tolerates a successful push
deploy / plan (push) Successful in 8s
deploy / archied-image (push) Canceled after 0s
deploy / agent-image (push) Canceled after 0s
deploy / dist-zip (push) Canceled after 0s
deploy / gate (push) Canceled after 1m47s

This commit is contained in:
sam committed 2026-11-09 14:40:19 +11:00
1 parent bcbd09fc08
commit 20ffe63367
1 file changed
+1 -1
+1 -1
View File
@@ -717,7 +717,7 @@ func (m *Manager) push(ctx context.Context, dir, branch, remoteURL string) error
})
}
err = publish()
if errors.Is(err, plumbing.ErrObjectNotFound) || strings.Contains(err.Error(), plumbing.ErrObjectNotFound.Error()) {
if errors.Is(err, plumbing.ErrObjectNotFound) || err != nil && 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)