mirror of
https://github.com/microsoft/vscode.git
synced 2026-04-28 12:33:35 +01:00
Git - fix bug causing multiple resource trust dialogs when worktrees are present (#290707)
This commit is contained in:
@@ -643,10 +643,13 @@ export class Model implements IRepositoryResolver, IBranchProtectionProviderRegi
|
||||
return;
|
||||
}
|
||||
|
||||
// Repository trust check
|
||||
// Get .git path and real path
|
||||
const [dotGit, repositoryRootRealPath] = await Promise.all([this.git.getRepositoryDotGit(repositoryRoot), this.getRepositoryRootRealPath(repositoryRoot)]);
|
||||
|
||||
// Check that the location of the .git folder is trusted
|
||||
const result = await workspace.requestResourceTrust({
|
||||
message: l10n.t('You are opening a repository from a location that is not trusted. Do you trust the authors of the files in the repository you are opening?'),
|
||||
uri: Uri.file(repoPath),
|
||||
uri: Uri.file(dotGit.commonPath ?? dotGit.path),
|
||||
} satisfies ResourceTrustRequestOptions);
|
||||
|
||||
if (!result) {
|
||||
@@ -655,7 +658,6 @@ export class Model implements IRepositoryResolver, IBranchProtectionProviderRegi
|
||||
}
|
||||
|
||||
// Open repository
|
||||
const [dotGit, repositoryRootRealPath] = await Promise.all([this.git.getRepositoryDotGit(repositoryRoot), this.getRepositoryRootRealPath(repositoryRoot)]);
|
||||
const gitRepository = this.git.open(repositoryRoot, repositoryRootRealPath, dotGit, this.logger);
|
||||
const repository = new Repository(gitRepository, this, this, this, this, this, this, this.globalState, this.logger, this.telemetryReporter, this._repositoryCache);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user