Ver a proveniência

Fixes issue with remote cache normalization

main
Eric Amodio há 7 anos
ascendente
cometimento
5de0196cee
1 ficheiros alterados com 9 adições e 3 eliminações
  1. +9
    -3
      src/gitService.ts

+ 9
- 3
src/gitService.ts Ver ficheiro

@ -913,23 +913,29 @@ export class GitService extends Disposable {
}
hasRemotes(repoPath: string): boolean {
const remotes = this._remotesCache.get(repoPath);
const remotes = this._remotesCache.get(this.normalizeRepoPath(repoPath));
return remotes !== undefined && remotes.length > 0;
}
private normalizeRepoPath(repoPath: string) {
return (repoPath.endsWith('/') ? repoPath : `${repoPath}/`).toLowerCase();
}
async getRemotes(repoPath: string): Promise<GitRemote[]> {
if (!repoPath) return [];
Logger.log(`getRemotes('${repoPath}')`);
let remotes = this._remotesCache.get(repoPath);
const normalizedRepoPath = this.normalizeRepoPath(repoPath);
let remotes = this._remotesCache.get(normalizedRepoPath);
if (remotes !== undefined) return remotes;
const data = await Git.remote(repoPath);
remotes = GitRemoteParser.parse(data, repoPath);
if (remotes !== undefined) {
this._remotesCache.set(repoPath, remotes);
this._remotesCache.set(normalizedRepoPath, remotes);
}
return remotes;

Carregando…
Cancelar
Guardar