@ -1193,7 +1193,7 @@ export class GitService extends Disposable {
if ( filePathOrUri instanceof GitUri ) return filePathOrUri . repoPath ;
if ( filePathOrUri instanceof GitUri ) return filePathOrUri . repoPath ;
// Don't save the tracking info to the cache, because we could be looking in the wrong place (e.g. looking in the root when the file is in a submodule)
// Don't save the tracking info to the cache, because we could be looking in the wrong place (e.g. looking in the root when the file is in a submodule)
cons t repo = await this . getRepository ( filePathOrUri , { . . . options , skipCacheUpdate : true } ) ;
le t repo = await this . getRepository ( filePathOrUri , { . . . options , skipCacheUpdate : true } ) ;
if ( repo !== undefined ) return repo . path ;
if ( repo !== undefined ) return repo . path ;
if ( typeof filePathOrUri !== 'string' ) {
if ( typeof filePathOrUri !== 'string' ) {
@ -1209,21 +1209,24 @@ export class GitService extends Disposable {
// If this new repo is inside one of our known roots and we we don't already know about, add it
// If this new repo is inside one of our known roots and we we don't already know about, add it
const root = this . _repositoryTree . findSubstr ( rp ) ;
const root = this . _repositoryTree . findSubstr ( rp ) ;
cons t folder = root === undefined
le t folder = root === undefined
? workspace . getWorkspaceFolder ( Uri . file ( rp ) )
? workspace . getWorkspaceFolder ( Uri . file ( rp ) )
: root . folder ;
: root . folder ;
if ( folder !== undefined ) {
const repo = new Repository ( folder , rp , false , this . onAnyRepositoryChanged . bind ( this ) , this . _suspended ) ;
this . _repositoryTree . set ( rp , repo ) ;
if ( folder === undefined ) {
const parts = rp . split ( '/' ) ;
folder = { uri : Uri.file ( rp ) , name : parts [ parts . length - 1 ] , index : this._repositoryTree.count ( ) } ;
}
// Send a notification that the repositories changed
setImmediate ( async ( ) = > {
await this . updateContext ( this . _repositoryTree ) ;
repo = new Repository ( folder , rp , false , this . onAnyRepositoryChanged . bind ( this ) , this . _suspended ) ;
this . _repositoryTree . set ( rp , repo ) ;
this . fireRepositoriesChanged ( ) ;
} ) ;
}
// Send a notification that the repositories changed
setImmediate ( async ( ) = > {
await this . updateContext ( this . _repositoryTree ) ;
this . fireRepositoriesChanged ( ) ;
} ) ;
return rp ;
return rp ;
}
}