feat(integrations): support automatic branch cleanup after merge
Add a new git::review_cleanup module that implements a CleanupPlan with prepare() and finish() routines to safely remove/clean tracking and local branches after a PR/MR is merged. The cleanup logic validates branch names, ensures a clean worktree, checks remotes/URLs, verifies commits/ancestry, protects against concurrent worktrees or divergent local/remote commits, and performs authenticated fetch/push and ref updates. Unit tests for the cleanup behavior are included. Wire provider-side cleanup into integrations: - add an integrations/cleanup module to read provider PR payloads and derive cleanup inputs - run cleanup::prepare(...) before performing a merge when an optional cleanup_path is provided - after a successful provider merge, run cleanup::finish(...); any failure is reported as MERGE_ACCEPTED_CLEANUP_FAILED Also: - export the new git review_cleanup module (src-tauri/src/git.rs) - accept an optional cleanup_path parameter in run_integration_review_action - remove the previous REVIEW_REQUEST_TIMEOUT wrapper around the spawned blocking task (the integration action is no longer wrapped with the 35s timeout)
This commit is contained in:
@@ -6117,6 +6117,14 @@
|
||||
localResolutionMessage={reviewConflictMessage}
|
||||
loadCredential={loadStoredCredential}
|
||||
onOpenSettings={() => { appSettingsOpen = true; }}
|
||||
onCleanupStateChange={async (busy, path) => {
|
||||
if (busy) {
|
||||
operation = appLanguage === "de" ? "PR zusammenführen und Branch aufräumen" : "Merging PR and cleaning up branch";
|
||||
} else {
|
||||
try { if (sameRepoPath(activeRepoPath, path)) await refreshRepositorySnapshot(path); }
|
||||
finally { operation = ""; }
|
||||
}
|
||||
}}
|
||||
onStartLocalResolution={startReviewConflictResolution}
|
||||
onOpenLocalResolver={reopenReviewConflictResolver}
|
||||
onContinueLocalResolution={continueReviewConflictMerge}
|
||||
|
||||
Reference in New Issue
Block a user