fix(worktree): match object-not-found by message too, as push transports may flatten it (#1843)

This commit is contained in:
sam committed 2026-11-09 14:37:18 +11:00
1 parent 70eef0ec99
commit a3fdbddfc0
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) {
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)