11'use strict' ;
2- import { Functions } from '../system' ;
2+ import { Functions , Strings } from '../system' ;
33import { commands , ConfigurationChangeEvent , ConfigurationTarget , Disposable , Event , EventEmitter , TreeDataProvider , TreeItem , window } from 'vscode' ;
44import { configuration , ExplorerFilesLayout , IExplorerConfig } from '../configuration' ;
5- import { CommandContext , setCommandContext , WorkspaceState } from '../constants' ;
5+ import { CommandContext , GlyphChars , setCommandContext , WorkspaceState } from '../constants' ;
66import { Container } from '../container' ;
77import { RefreshNodeCommandArgs } from './explorerCommands' ;
88import { CommitResultsNode , CommitsResultsNode , ComparisionResultsNode , ExplorerNode , MessageNode , RefreshReason , ResourceType } from './explorerNodes' ;
@@ -138,7 +138,7 @@ export class ResultsExplorer extends Disposable implements TreeDataProvider<Expl
138138 ? ( maxCount : number | undefined ) => Promise . resolve ( results )
139139 : results . query ;
140140
141- const labelFn = ( log : GitLog | undefined ) => {
141+ const labelFn = async ( log : GitLog | undefined ) => {
142142 if ( typeof resultsLabel === 'string' ) return resultsLabel ;
143143
144144 const count = log !== undefined ? log . count : 0 ;
@@ -148,8 +148,14 @@ export class ResultsExplorer extends Disposable implements TreeDataProvider<Expl
148148 ? { singular : 'result' , plural : 'results' }
149149 : resultsLabel . resultsType ;
150150
151- if ( count === 1 ) return `1 ${ resultsType . singular } for ${ resultsLabel . label } ` ;
152- return `${ count === 0 ? 'No' : `${ count } ${ truncated ? '+' : '' } ` } ${ resultsType . plural } for ${ resultsLabel . label } ` ;
151+ let repository = '' ;
152+ if ( await Container . git . getRepositoryCount ( ) > 1 ) {
153+ const repo = await Container . git . getRepository ( results . repoPath ) ;
154+ repository = ` ${ Strings . pad ( GlyphChars . Dash , 1 , 1 ) } ${ ( repo && repo . formattedName ) || results . repoPath } ` ;
155+ }
156+
157+ if ( count === 1 ) return `1 ${ resultsType . singular } for ${ resultsLabel . label } ${ repository } ` ;
158+ return `${ count === 0 ? 'No' : `${ count } ${ truncated ? '+' : '' } ` } ${ resultsType . plural } for ${ resultsLabel . label } ${ repository } ` ;
153159 } ;
154160
155161 this . addResults ( new CommitsResultsNode ( results . repoPath , labelFn , Functions . seeded ( query , results ) , this , ResourceType . SearchResults ) ) ;
0 commit comments