Skip to content

Commit aa012da

Browse files
Copilotalexr00
andcommitted
Add notification when branch is auto-deleted after merge
Co-authored-by: alexr00 <38270282+alexr00@users.noreply.github.com>
1 parent e21b878 commit aa012da

1 file changed

Lines changed: 17 additions & 1 deletion

File tree

src/github/pullRequestReviewCommon.ts

Lines changed: 17 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -462,6 +462,22 @@ export namespace PullRequestReviewCommon {
462462
}
463463

464464
// Execute all deletions in parallel
465-
await performBranchDeletion(folderRepositoryManager, item, defaultBranch, branchInfo!, selectedActions);
465+
const deletedBranchTypes = await performBranchDeletion(folderRepositoryManager, item, defaultBranch, branchInfo!, selectedActions);
466+
467+
// Show notification to the user about what was deleted
468+
if (deletedBranchTypes.length > 0) {
469+
const wasLocalDeleted = deletedBranchTypes.includes('local');
470+
const branchName = branchInfo?.branch || item.head?.ref || vscode.l10n.t('branch');
471+
472+
if (wasLocalDeleted) {
473+
vscode.window.showInformationMessage(
474+
vscode.l10n.t('Deleted local branch {0} and switched to {1}.', branchName, defaultBranch)
475+
);
476+
} else {
477+
vscode.window.showInformationMessage(
478+
vscode.l10n.t('Deleted remote branch {0}.', branchName)
479+
);
480+
}
481+
}
466482
}
467483
}

0 commit comments

Comments
 (0)