doctor: reopen repo after deepening metadata branch

Commit

Soph3mo ago

Trail finding (high): checkDisconnectedMetadata kept using the repo handle opened before DeepenMetadataBranch shelled out to git, then ran the connectivity check (and any reconcile) against that stale handle.

go-git v6's ShallowStorage.Shallow() actually reads .git/shallow fresh on every call, and the disconnection checks themselves shell out to git CLI (merge-base / rev-list), so the deepen's effect is observed correctly today. But depending on that is fragile, and the codebase already reopens after git operations (resume.go's freshRepo) to avoid storer/pack-index staleness.

Swap to a freshly opened repo after a successful deepen so detection and reconcile operate on a handle that knows about the fetched objects. The deferred close is now a closure so the post-swap handle is the one closed.

Co-Authored-By: Claude Opus 4.8 (1M context) noreply@anthropic.com Entire-Checkpoint: 80fc470879d1

Checkpoints

can you review the PR / Branch

CodexGPT-5.5
View session
Checkpoint 1

so in ../entiredb "filtered_fetches" is enabled, now today one of my coworkers had this issue:

Claude Code
View session
Checkpoint 1