@ -96,6 +96,7 @@ import type {
GraphMissingRefsMetadataType ,
GraphPullRequestMetadata ,
GraphRefMetadata ,
GraphRefMetadataType ,
GraphRepository ,
GraphSelectedRows ,
GraphUpstreamMetadata ,
@ -131,8 +132,10 @@ import {
GetMissingAvatarsCommandType ,
GetMissingRefsMetadataCommandType ,
GetMoreRowsCommandType ,
GraphRefMetadataTypes ,
SearchCommandType ,
SearchOpenInViewCommandType ,
supportedRefMetadataTypes ,
UpdateColumnsCommandType ,
UpdateExcludeTypeCommandType ,
UpdateIncludeOnlyRefsCommandType ,
@ -546,6 +549,7 @@ export class GraphWebview extends WebviewBase {
configuration . changed ( e , 'graph.highlightRowsOnRefHover' ) ||
configuration . changed ( e , 'graph.scrollRowPadding' ) ||
configuration . changed ( e , 'graph.showGhostRefsOnRowHover' ) ||
configuration . changed ( e , 'graph.pullRequests.enabled' ) ||
configuration . changed ( e , 'graph.showRemoteNames' ) ||
configuration . changed ( e , 'graph.showUpstreamStatus' )
) {
@ -739,14 +743,14 @@ export class GraphWebview extends WebviewBase {
}
for ( const type of missingTypes ) {
if ( type !== 'pullRequests' && type !== 'upstream' ) {
if ( ! supportedRefMetadataTypes . includes ( type ) ) {
( metadata as any ) [ type ] = null ;
this . _refsMetadata . set ( id , metadata ) ;
continue ;
}
if ( type === 'pullRequests' ) {
if ( type === GraphRefMetadataTypes . PullRequest ) {
const pr = await branch ? . getAssociatedPullRequest ( ) ;
if ( pr == null ) {
@ -783,7 +787,7 @@ export class GraphWebview extends WebviewBase {
continue ;
}
if ( type === 'upstream' ) {
if ( type === GraphRefMetadataTypes . Upstream ) {
const upstream = branch ? . upstream ;
if ( upstream == null || upstream == undefined || upstream . missing ) {
@ -1555,18 +1559,31 @@ export class GraphWebview extends WebviewBase {
dateFormat :
configuration . get ( 'graph.dateFormat' ) ? ? configuration . get ( 'defaultDateFormat' ) ? ? 'short+short' ,
dateStyle : configuration.get ( 'graph.dateStyle' ) ? ? configuration . get ( 'defaultDateStyle' ) ,
enabledRefMetadataTypes : this.getEnabledRefMetadataTypes ( ) ,
dimMergeCommits : configuration.get ( 'graph.dimMergeCommits' ) ,
enableMultiSelection : false ,
highlightRowsOnRefHover : configuration.get ( 'graph.highlightRowsOnRefHover' ) ,
scrollRowPadding : configuration.get ( 'graph.scrollRowPadding' ) ,
showGhostRefsOnRowHover : configuration.get ( 'graph.showGhostRefsOnRowHover' ) ,
showRemoteNamesOnRefs : configuration.get ( 'graph.showRemoteNames' ) ,
showUpstreamStatus : configuration.get ( 'graph.showUpstreamStatus' ) ,
idLength : configuration.get ( 'advanced.abbreviatedShaLength' ) ,
} ;
return config ;
}
private getEnabledRefMetadataTypes ( ) : GraphRefMetadataType [ ] {
const types : GraphRefMetadataType [ ] = [ ] ;
if ( configuration . get ( 'graph.pullRequests.enabled' ) ) {
types . push ( GraphRefMetadataTypes . PullRequest as GraphRefMetadataType ) ;
}
if ( configuration . get ( 'graph.showUpstreamStatus' ) ) {
types . push ( GraphRefMetadataTypes . Upstream as GraphRefMetadataType ) ;
}
return types ;
}
private async getGraphAccess() {
let access = await this . container . git . access ( PlusFeatures . Graph , this . repository ? . path ) ;
this . _etagSubscription = this . container . subscription . etag ;