Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions extensions/git/src/commands.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1155,7 +1155,7 @@ export class CommandCenter {
path = result[0].fsPath;
}

await this.model.openRepository(path, true);
await this.model.openRepository(path, true, true);
}

@command('git.reopenClosedRepositories', { repository: false })
Expand Down Expand Up @@ -1191,7 +1191,7 @@ export class CommandCenter {
}

for (const repository of closedRepositories) {
await this.model.openRepository(repository, true);
await this.model.openRepository(repository, true, true);
}
}

Expand Down Expand Up @@ -3701,7 +3701,7 @@ export class CommandCenter {
}

private async handleWorktreeConflict(path: string, message: string): Promise<void> {
await this.model.openRepository(path, true);
await this.model.openRepository(path, true, true);

const worktreeRepository = this.model.getRepository(path);

Expand Down
4 changes: 2 additions & 2 deletions extensions/git/src/model.ts
Original file line number Diff line number Diff line change
Expand Up @@ -572,7 +572,7 @@ export class Model implements IRepositoryResolver, IBranchProtectionProviderRegi
}

@sequentialize
async openRepository(repoPath: string, openIfClosed = false): Promise<void> {
async openRepository(repoPath: string, openIfClosed = false, openIfParent = false): Promise<void> {
this.logger.trace(`[Model][openRepository] Repository: ${repoPath}`);
const existingRepository = await this.getRepositoryExact(repoPath);
if (existingRepository) {
Expand Down Expand Up @@ -607,7 +607,7 @@ export class Model implements IRepositoryResolver, IBranchProtectionProviderRegi
const parentRepositoryConfig = config.get<'always' | 'never' | 'prompt'>('openRepositoryInParentFolders', 'prompt');
if (parentRepositoryConfig !== 'always' && this.globalState.get<boolean>(`parentRepository:${repositoryRoot}`) !== true) {
const isRepositoryOutsideWorkspace = await this.isRepositoryOutsideWorkspace(repositoryRoot);
if (isRepositoryOutsideWorkspace) {
if (!openIfParent && isRepositoryOutsideWorkspace) {
this.logger.trace(`[Model][openRepository] Repository in parent folder: ${repositoryRoot}`);

if (!this._parentRepositoriesManager.hasRepository(repositoryRoot)) {
Expand Down
Loading