mirror of
https://github.com/microsoft/vscode.git
synced 2025-12-24 20:26:08 +00:00
Git - discover nested git repositories (#159291)
This commit is contained in:
@@ -323,7 +323,7 @@ export class Model implements IRemoteSourcePublisherRegistry, IPostCommitCommand
|
||||
@sequentialize
|
||||
async openRepository(repoPath: string): Promise<void> {
|
||||
this.outputChannelLogger.logTrace(`Opening repository: ${repoPath}`);
|
||||
if (this.getRepository(repoPath)) {
|
||||
if (this.getRepositoryExact(repoPath)) {
|
||||
this.outputChannelLogger.logTrace(`Repository for path ${repoPath} already exists`);
|
||||
return;
|
||||
}
|
||||
@@ -359,7 +359,7 @@ export class Model implements IRemoteSourcePublisherRegistry, IPostCommitCommand
|
||||
const repositoryRoot = Uri.file(rawRoot).fsPath;
|
||||
this.outputChannelLogger.logTrace(`Repository root: ${repositoryRoot}`);
|
||||
|
||||
if (this.getRepository(repositoryRoot)) {
|
||||
if (this.getRepositoryExact(repositoryRoot)) {
|
||||
this.outputChannelLogger.logTrace(`Repository for path ${repositoryRoot} already exists`);
|
||||
return;
|
||||
}
|
||||
@@ -510,6 +510,12 @@ export class Model implements IRemoteSourcePublisherRegistry, IPostCommitCommand
|
||||
return liveRepository && liveRepository.repository;
|
||||
}
|
||||
|
||||
private getRepositoryExact(repoPath: string): Repository | undefined {
|
||||
const openRepository = this.openRepositories
|
||||
.find(r => pathEquals(r.repository.root, repoPath));
|
||||
return openRepository?.repository;
|
||||
}
|
||||
|
||||
private getOpenRepository(repository: Repository): OpenRepository | undefined;
|
||||
private getOpenRepository(sourceControl: SourceControl): OpenRepository | undefined;
|
||||
private getOpenRepository(resourceGroup: SourceControlResourceGroup): OpenRepository | undefined;
|
||||
|
||||
Reference in New Issue
Block a user