@@ -246,6 +246,11 @@ export class Repository implements Disposable {
246246 return this . _onDidChangeFileSystem . event ;
247247 }
248248
249+ private _commonRepositoryName : string | undefined ;
250+ get commonRepositoryName ( ) : string | undefined {
251+ return this . _commonRepositoryName ;
252+ }
253+
249254 get formattedName ( ) : string {
250255 return this . name ;
251256 }
@@ -258,11 +263,6 @@ export class Repository implements Disposable {
258263 return this . _name ;
259264 }
260265
261- private _nameWithoutWorktree : string ;
262- get nameWithoutWorktree ( ) : string {
263- return this . _nameWithoutWorktree ;
264- }
265-
266266 private _idHash : string | undefined ;
267267 get idHash ( ) {
268268 if ( this . _idHash === undefined ) {
@@ -306,8 +306,6 @@ export class Repository implements Disposable {
306306 // };
307307 }
308308
309- this . _nameWithoutWorktree = this . _name ;
310-
311309 // Update the name if it is a worktree
312310 void this . git . getGitDir ( ) . then ( gd => {
313311 if ( gd ?. commonUri == null ) return ;
@@ -317,7 +315,8 @@ export class Repository implements Disposable {
317315 path = path . substring ( 0 , path . length - 5 ) ;
318316 }
319317
320- const prefix = `${ basename ( path ) } : ` ;
318+ this . _commonRepositoryName = basename ( path ) ;
319+ const prefix = `${ this . _commonRepositoryName } : ` ;
321320 if ( ! this . _name . startsWith ( prefix ) ) {
322321 this . _name = `${ prefix } ${ this . _name } ` ;
323322 }
0 commit comments