Skip to content

Commit 6ec5bea

Browse files
Copilotalexr00
andcommitted
Hide worktree delete option when worktree is a workspace folder
Co-authored-by: alexr00 <38270282+alexr00@users.noreply.github.com>
1 parent e13faa9 commit 6ec5bea

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

src/github/pullRequestReviewCommon.ts

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -302,6 +302,10 @@ export namespace PullRequestReviewCommon {
302302
worktreePath?: string;
303303
};
304304

305+
function isWorktreeInWorkspace(worktreePath: string): boolean {
306+
return !!vscode.workspace.workspaceFolders?.some(folder => folder.uri.fsPath === worktreePath);
307+
}
308+
305309
export async function deleteBranch(folderRepositoryManager: FolderRepositoryManager, item: PullRequestModel): Promise<{ isReply: boolean, message: any }> {
306310
const branchInfo = await folderRepositoryManager.getBranchNameForPullRequest(item);
307311
const actions: (vscode.QuickPickItem & SelectedAction)[] = [];

0 commit comments

Comments
 (0)