File tree Expand file tree Collapse file tree 1 file changed +10
-2
lines changed
Expand file tree Collapse file tree 1 file changed +10
-2
lines changed Original file line number Diff line number Diff line change @@ -29,6 +29,14 @@ export interface ReviewContext {
2929 getTimeline ( ) : Promise < TimelineEvent [ ] > ;
3030}
3131
32+ function isWorktreeInWorkspace ( worktreePath : string ) : boolean {
33+ const workspaceFolders = vscode . workspace . workspaceFolders ;
34+ if ( ! workspaceFolders ) {
35+ return false ;
36+ }
37+ return workspaceFolders . some ( folder => folder . uri . fsPath === worktreePath ) ;
38+ }
39+
3240/**
3341 * Utility functions for handling pull request reviews.
3442 * These are shared between PullRequestOverviewPanel and PullRequestViewProvider.
@@ -337,7 +345,7 @@ export namespace PullRequestReviewCommon {
337345 }
338346
339347 const worktreePath = folderRepositoryManager . getWorktreeForBranch ( branchInfo . branch ) ;
340- if ( worktreePath ) {
348+ if ( worktreePath && ! isWorktreeInWorkspace ( worktreePath ) ) {
341349 const preferredWorktreeDeletion = vscode . workspace
342350 . getConfiguration ( PR_SETTINGS_NAMESPACE )
343351 . get < boolean > ( `${ DEFAULT_DELETION_METHOD } .${ SELECT_WORKTREE } ` ) ;
@@ -527,7 +535,7 @@ export namespace PullRequestReviewCommon {
527535 . get < boolean > ( `${ DEFAULT_DELETION_METHOD } .${ SELECT_WORKTREE } ` , false ) ;
528536 if ( branchInfo && deleteWorktree ) {
529537 const worktreePath = folderRepositoryManager . getWorktreeForBranch ( branchInfo . branch ) ;
530- if ( worktreePath ) {
538+ if ( worktreePath && ! isWorktreeInWorkspace ( worktreePath ) ) {
531539 selectedActions . push ( { type : 'worktree' , worktreePath } ) ;
532540 }
533541 }
You can’t perform that action at this time.
0 commit comments