@@ -2,7 +2,7 @@ import { css, html, LitElement, nothing } from 'lit';
22import { customElement , property , state } from 'lit/decorators.js' ;
33import { createCommandLink } from '../../../../../system/commands' ;
44import { pluralize } from '../../../../../system/string' ;
5- import type { BranchRef , GetOverviewBranch } from '../../../../home/protocol' ;
5+ import type { BranchAndTargetRefs , BranchRef , GetOverviewBranch } from '../../../../home/protocol' ;
66import { renderBranchName } from '../../../shared/components/branch-name' ;
77import { elementBase , linkBase , scrollableBase } from '../../../shared/components/styles/lit/base.css' ;
88import { chipStyles } from '../../shared/components/chipStyles' ;
@@ -414,19 +414,27 @@ export class GlMergeTargetStatus extends LitElement {
414414 }
415415
416416 private renderActions ( ) {
417+ const branchRef = this . branchRef ;
418+ const targetRef = this . targetBranchRef ;
419+
417420 return html `< span class ="header__actions "
418- > < gl-button
419- href ="${ createCommandLink ( 'gitlens.home.openMergeTargetComparison' , {
420- ...this . branchRef ,
421- mergeTargetId : this . targetBranchRef ?. branchId ,
422- } ) } "
421+ > ${ branchRef && targetRef
422+ ? html `< gl-button
423+ href ="${ createCommandLink < BranchAndTargetRefs > ( 'gitlens.home.openMergeTargetComparison' , {
424+ ...branchRef ,
425+ mergeTargetId : targetRef . branchId ,
426+ mergeTargetName : targetRef . branchName ,
427+ } ) } "
428+ appearance ="toolbar "
429+ > < code-icon icon ="git-compare "> </ code-icon >
430+ < span slot ="tooltip "
431+ > Compare Branch with Merge Target< br /> ${ renderBranchName ( this . branch . name ) }
432+ ↔ ${ renderBranchName ( this . target ?. name ) } </ span
433+ >
434+ </ gl-button > `
435+ : nothing } < gl-button
436+ href ="${ createCommandLink ( 'gitlens.home.fetch' , this . targetBranchRef ) } "
423437 appearance ="toolbar "
424- > < code-icon icon ="git-compare "> </ code-icon >
425- < span slot ="tooltip "
426- > Compare Branch with Merge Target< br /> ${ renderBranchName ( this . branch . name ) } ↔
427- ${ renderBranchName ( this . target ?. name ) } </ span
428- > </ gl-button
429- > < gl-button href ="${ createCommandLink ( 'gitlens.home.fetch' , this . targetBranchRef ) } " appearance ="toolbar "
430438 > < code-icon icon ="repo-fetch "> </ code-icon >
431439 < span slot ="tooltip "> Fetch Merge Target< br /> ${ renderBranchName ( this . target ?. name ) } </ span >
432440 </ gl-button > </ span
0 commit comments