Selaa lähdekoodia

Fixes issue with remote cache normalization

main
Eric Amodio 7 vuotta sitten
vanhempi
commit
5de0196cee
1 muutettua tiedostoa jossa 9 lisäystä ja 3 poistoa
  1. +9
    -3
      src/gitService.ts

+ 9
- 3
src/gitService.ts Näytä tiedosto

@ -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;

Ladataan…
Peruuta
Tallenna