Git - improve getRepositoryExact() error handling (#191462)

* Git - improve getRepositoryExact() error handling

* Run async operations in parallel
This commit is contained in:
Ladislau Szomoru
2023-08-28 16:34:46 +02:00
committed by GitHub
parent 4b37efe375
commit c7d46b2430
3 changed files with 40 additions and 11 deletions

View File

@@ -397,8 +397,8 @@ export class Git {
return Versions.compare(Versions.fromString(this.version), Versions.fromString(version));
}
open(repository: string, dotGit: { path: string; commonPath?: string }, logger: LogOutputChannel): Repository {
return new Repository(this, repository, dotGit, logger);
open(repositoryRoot: string, repositoryRootRealPath: string | undefined, dotGit: { path: string; commonPath?: string }, logger: LogOutputChannel): Repository {
return new Repository(this, repositoryRoot, repositoryRootRealPath, dotGit, logger);
}
async init(repository: string, options: InitOptions = {}): Promise<void> {
@@ -956,6 +956,7 @@ export class Repository {
constructor(
private _git: Git,
private repositoryRoot: string,
private repositoryRootRealPath: string | undefined,
readonly dotGit: { path: string; commonPath?: string },
private logger: LogOutputChannel
) { }
@@ -968,6 +969,10 @@ export class Repository {
return this.repositoryRoot;
}
get rootRealPath(): string | undefined {
return this.repositoryRootRealPath;
}
async exec(args: string[], options: SpawnOptions = {}): Promise<IExecutionResult<string>> {
return await this.git.exec(this.repositoryRoot, args, options);
}