Quellcode durchsuchen

Fixes issue with remote cache normalization

main
Eric Amodio vor 7 Jahren
Ursprung
Commit
5de0196cee
1 geänderte Dateien mit 9 neuen und 3 gelöschten Zeilen
  1. +9
    -3
      src/gitService.ts

+ 9
- 3
src/gitService.ts Datei anzeigen

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

Laden…
Abbrechen
Speichern