@@ -439,7 +439,7 @@ export class Model implements IRepositoryResolver, IBranchProtectionProviderRegi
439
439
@debounce ( 500 )
440
440
private eventuallyScanPossibleGitRepositories ( ) : void {
441
441
for ( const path of this . possibleGitRepositoryPaths ) {
442
- this . openRepository ( path ) ;
442
+ this . openRepository ( path , false , true ) ;
443
443
}
444
444
445
445
this . possibleGitRepositoryPaths . clear ( ) ;
@@ -548,7 +548,7 @@ export class Model implements IRepositoryResolver, IBranchProtectionProviderRegi
548
548
}
549
549
550
550
@sequentialize
551
- async openRepository ( repoPath : string , openIfClosed = false ) : Promise < void > {
551
+ async openRepository ( repoPath : string , openIfClosed = false , openIfParent = false ) : Promise < void > {
552
552
this . logger . trace ( `[Model][openRepository] Repository: ${ repoPath } ` ) ;
553
553
const existingRepository = await this . getRepositoryExact ( repoPath ) ;
554
554
if ( existingRepository ) {
@@ -597,7 +597,7 @@ export class Model implements IRepositoryResolver, IBranchProtectionProviderRegi
597
597
const parentRepositoryConfig = config . get < 'always' | 'never' | 'prompt' > ( 'openRepositoryInParentFolders' , 'prompt' ) ;
598
598
if ( parentRepositoryConfig !== 'always' && this . globalState . get < boolean > ( `parentRepository:${ repositoryRoot } ` ) !== true ) {
599
599
const isRepositoryOutsideWorkspace = await this . isRepositoryOutsideWorkspace ( repositoryRoot ) ;
600
- if ( isRepositoryOutsideWorkspace ) {
600
+ if ( ! openIfParent && isRepositoryOutsideWorkspace ) {
601
601
this . logger . trace ( `[Model][openRepository] Repository in parent folder: ${ repositoryRoot } ` ) ;
602
602
603
603
if ( ! this . _parentRepositoriesManager . hasRepository ( repositoryRoot ) ) {
0 commit comments