@@ -2,7 +2,7 @@ import { css, html, LitElement, nothing } from 'lit';
2
2
import { customElement , property , state } from 'lit/decorators.js' ;
3
3
import { createCommandLink } from '../../../../../system/commands' ;
4
4
import { pluralize } from '../../../../../system/string' ;
5
- import type { BranchRef , GetOverviewBranch } from '../../../../home/protocol' ;
5
+ import type { BranchAndTargetRefs , BranchRef , GetOverviewBranch } from '../../../../home/protocol' ;
6
6
import { renderBranchName } from '../../../shared/components/branch-name' ;
7
7
import { elementBase , linkBase , scrollableBase } from '../../../shared/components/styles/lit/base.css' ;
8
8
import { chipStyles } from '../../shared/components/chipStyles' ;
@@ -414,19 +414,27 @@ export class GlMergeTargetStatus extends LitElement {
414
414
}
415
415
416
416
private renderActions ( ) {
417
+ const branchRef = this . branchRef ;
418
+ const targetRef = this . targetBranchRef ;
419
+
417
420
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 ) } "
423
437
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 "
430
438
> < code-icon icon ="repo-fetch "> </ code-icon >
431
439
< span slot ="tooltip "> Fetch Merge Target< br /> ${ renderBranchName ( this . target ?. name ) } </ span >
432
440
</ gl-button > </ span
0 commit comments