feat(store): enhance repository handling and corruption recovery logic
- Added safeguards against repository corruption with improved recovery mechanisms, including remote re-cloning and worktree restoration. - Introduced fine-grained repository integrity checks and missing file restoration logic. - Centralized repository locking with `ensureRepositoryLocked` to standardize synchronization. - Enhanced conflict resolution during pulls with automated reconciliation of remote and local changes. - Improved worktree and index reset workflows to handle dirty and missing paths gracefully. - Increased robustness for garbage collection with extended grace period and recovery paths. Closes: #4629
L
Luis Pater committed
a2ff6914bb49d125132c80169590939ac1b2e8d8
Parent: 2b63d6b