Commit Graph

6 Commits

Author SHA1 Message Date
hkfires
b908ed5d86 fix(store): close git repos during recovery
Close go-git repository handles across store operations and tests to avoid
leaked handles blocking recovery cleanup. Abort recovery before mutating the
worktree when close failures occur and retain backups when rollback fails.
2026-08-31 08:41:08 +08:00
Luis Pater
a2ff6914bb 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
2026-07-30 05:46:44 +08:00
Luis Pater
e49b1cc76f feat(store): add guard for watcher-originated auth file deletions
- Implemented `guardWatcherAuthRemovalLocked` to prevent unauthorized watcher-triggered deletions of tracked auth files.
- Updated `PersistAuthFiles` to handle redundant watcher events safely after intentional deletions.
- Improved error handling for git tree and repository inspections during watcher removal validation.
- Enhanced `commitAndPushLocked` logic to perform additional checks before committing changes.
- Added comprehensive tests to validate watcher-originated deletion safeguards and correct behavior for explicit deletions.

Closes: #4438
2026-07-27 07:05:19 +08:00
Luis Pater
71b5beb8b9 feat(gitstore): migrate to new client options API and disable commit signing
- Updated git operations to leverage `ClientOptions` for authentication and configuration, replacing the deprecated `AuthMethod`.
- Implemented logic to disable GPG commit signing in repositories to prevent signature errors in automated workflows.
- Upgraded dependencies in `go.mod` and `go.sum` to align with the latest `github.com/go-git/go-git/v6` alpha releases.
- Added unit tests to verify commit signing is properly disabled in repositories.

Closes: #4341
2026-07-16 01:44:28 +08:00
Luis Pater
30a8824b64 fix(gitstore): adjust garbage collection to run after push operation
- Updated `maybeRunGC` to accept `repoDir` instead of `repo`.
- Moved garbage collection trigger to occur after the push step for improved reliability.
- Added a test to validate the sequence of push and GC operations.

Closes: #3373
2026-05-16 04:55:44 +08:00
Duong M. CUONG
058793c73a feat(gitstore): honor configured branch and follow live remote default 2026-04-02 14:44:44 +00:00