@@ -18,18 +18,19 @@ import { PullRequestModel } from './pullRequestModel';
1818export namespace PullRequestView {
1919 export async function deleteBranch ( folderRepositoryManager : FolderRepositoryManager , item : PullRequestModel ) : Promise < { isReply : boolean , message : any } > {
2020 const branchInfo = await folderRepositoryManager . getBranchNameForPullRequest ( item ) ;
21- const actions : ( vscode . QuickPickItem & { type : 'upstream ' | 'local' | 'remote' | 'suspend' } ) [ ] = [ ] ;
21+ const actions : ( vscode . QuickPickItem & { type : 'remoteHead ' | 'local' | 'remote' | 'suspend' } ) [ ] = [ ] ;
2222 const defaultBranch = await folderRepositoryManager . getPullRequestRepositoryDefaultBranch ( item ) ;
2323
2424 if ( item . isResolved ( ) ) {
2525 const branchHeadRef = item . head . ref ;
26+ const headRepo = folderRepositoryManager . findRepo ( repo => repo . remote . owner === item . head . owner && repo . remote . repositoryName === item . remote . repositoryName ) ;
2627
2728 const isDefaultBranch = defaultBranch === item . head . ref ;
2829 if ( ! isDefaultBranch && ! item . isRemoteHeadDeleted ) {
2930 actions . push ( {
30- label : vscode . l10n . t ( 'Delete remote branch {0}' , `${ item . remote . remoteName } /${ branchHeadRef } ` ) ,
31- description : `${ item . remote . normalizedHost } /${ item . remote . owner } /${ item . remote . repositoryName } ` ,
32- type : 'upstream ' ,
31+ label : vscode . l10n . t ( 'Delete remote branch {0}' , `${ headRepo ? .remote . remoteName } /${ branchHeadRef } ` ) ,
32+ description : `${ item . remote . normalizedHost } /${ item . head . repositoryCloneUrl . owner } /${ item . remote . repositoryName } ` ,
33+ type : 'remoteHead ' ,
3334 picked : true ,
3435 } ) ;
3536 }
@@ -89,7 +90,7 @@ export namespace PullRequestView {
8990
9091 const promises = selectedActions . map ( async action => {
9192 switch ( action . type ) {
92- case 'upstream ' :
93+ case 'remoteHead ' :
9394 await folderRepositoryManager . deleteBranch ( item ) ;
9495 deletedBranchTypes . push ( action . type ) ;
9596 await folderRepositoryManager . repository . fetch ( { prune : true } ) ;
0 commit comments