@@ -285,14 +285,25 @@ export class GlMergeTargetStatus extends LitElement {
285285 private renderContent ( ) {
286286 const target = renderBranchName ( this . target ?. name ) ;
287287
288+ const mergeTargetRef =
289+ this . mergedStatus ?. merged && this . mergedStatus . localBranchOnly
290+ ? {
291+ repoPath : this . branch . repoPath ,
292+ branchId : this . mergedStatus . localBranchOnly . id ! ,
293+ branchName : this . mergedStatus . localBranchOnly . name ,
294+ branchUpstreamName : this . mergedStatus . localBranchOnly . upstream ?. name ,
295+ }
296+ : this . target
297+ ? {
298+ repoPath : this . target . repoPath ,
299+ branchId : this . target . id ,
300+ branchName : this . target . name ,
301+ branchUpstreamName : undefined ,
302+ }
303+ : undefined ;
304+
288305 if ( this . mergedStatus ?. merged ) {
289306 if ( this . mergedStatus . localBranchOnly ) {
290- const mergeTargetRef = {
291- repoPath : this . branch . repoPath ,
292- branchId : this . mergedStatus . localBranchOnly . id ! ,
293- branchName : this . mergedStatus . localBranchOnly . name ,
294- branchUpstreamName : this . mergedStatus . localBranchOnly . upstream ?. name ,
295- } ;
296307 return html `< div class ="header ">
297308 < span class ="header__title "
298309 > < code-icon icon ="git-merge "> </ code-icon > Branch
@@ -312,7 +323,7 @@ export class GlMergeTargetStatus extends LitElement {
312323 full
313324 href ="${ createCommandLink (
314325 'gitlens.home.pushBranch' ,
315- mergeTargetRef satisfies BranchRef ,
326+ mergeTargetRef ! satisfies BranchRef ,
316327 ) } "
317328 > Push ${ renderBranchName ( this . mergedStatus . localBranchOnly . name ) } </ gl-button
318329 >
@@ -350,7 +361,10 @@ export class GlMergeTargetStatus extends LitElement {
350361 < div class ="button-container ">
351362 < gl-button
352363 full
353- href ="${ createCommandLink ( 'gitlens.home.deleteBranchOrWorktree' , this . branchRef ) } "
364+ href ="${ createCommandLink ( 'gitlens.home.deleteBranchOrWorktree' , [
365+ this . branchRef ,
366+ mergeTargetRef ,
367+ ] ) } "
354368 > Delete
355369 ${ this . branch . worktree != null && ! this . branch . worktree . isDefault ? 'Worktree' : 'Branch' }
356370 ${ renderBranchName ( this . branch . name , this . branch . worktree != null ) } </ gl-button
0 commit comments