Browse Source

Removes unused version uri cache

main
Eric Amodio 6 years ago
parent
commit
fb09ce08a3
3 changed files with 1 additions and 24 deletions
  1. +0
    -18
      src/git/gitService.ts
  2. +0
    -3
      src/git/gitUri.ts
  3. +1
    -3
      src/views/nodes/repositoriesNode.ts

+ 0
- 18
src/git/gitService.ts View File

@ -98,12 +98,10 @@ export class GitService implements Disposable {
private _repositoriesLoadingPromise: Promise<void> | undefined;
private _suspended: boolean = false;
private readonly _trackedCache: Map<string, boolean | Promise<boolean>>;
private _versionedUriCache: Map<string, GitUri>;
constructor() {
this._repositoryTree = TernarySearchTree.forPaths();
this._trackedCache = new Map();
this._versionedUriCache = new Map();
this._disposable = Disposable.from(
window.onDidChangeWindowState(this.onWindowStateChanged, this),
@ -118,7 +116,6 @@ export class GitService implements Disposable {
dispose() {
this._repositoryTree.forEach(r => r.dispose());
this._trackedCache.clear();
this._versionedUriCache.clear();
this._disposable && this._disposable.dispose();
}
@ -1500,11 +1497,6 @@ export class GitService implements Disposable {
let repo = await this.getRepository(filePathOrUri, { ...options, skipCacheUpdate: true });
if (repo !== undefined) return repo.path;
if (typeof filePathOrUri !== 'string') {
const versionedUri = await Container.git.getVersionedUri(filePathOrUri);
if (versionedUri !== undefined) return versionedUri.repoPath;
}
const rp = await this.getRepoPathCore(
typeof filePathOrUri === 'string' ? filePathOrUri : filePathOrUri.fsPath,
false
@ -1708,16 +1700,6 @@ export class GitService implements Disposable {
return Git.show<Buffer>(repoPath, fileName, ref, { encoding: 'buffer' });
}
// getVersionedFileText(repoPath: string, fileName: string, ref: string) {
// Logger.log(`getVersionedFileText('${repoPath}', '${fileName}', ${ref})`);
// return Git.show<string>(repoPath, fileName, ref, { encoding: GitService.getEncoding(repoPath, fileName) });
// }
getVersionedUri(uri: Uri) {
return this._versionedUriCache.get(GitUri.toKey(uri));
}
isTrackable(scheme: string): boolean;
isTrackable(uri: Uri): boolean;
isTrackable(schemeOruri: string | Uri): boolean {

+ 0
- 3
src/git/gitUri.ts View File

@ -218,9 +218,6 @@ export class GitUri extends ((Uri as any) as UriEx) {
} as GitCommitish);
}
const versionedUri = await Container.git.getVersionedUri(uri);
if (versionedUri !== undefined) return versionedUri;
return new GitUri(uri, await Container.git.getRepoPath(uri));
}

+ 1
- 3
src/views/nodes/repositoriesNode.ts View File

@ -172,9 +172,7 @@ export class RepositoriesNode extends SubscribeableExplorerNode
try {
const uri = editor.document.uri;
const gitUri = await Container.git.getVersionedUri(uri);
const node = this._children.find(n => n instanceof RepositoryNode && n.repo.containsUri(gitUri || uri)) as
const node = this._children.find(n => n instanceof RepositoryNode && n.repo.containsUri(uri)) as
| RepositoryNode
| undefined;
if (node === undefined) return;

Loading…
Cancel
Save