Ver código fonte

Caches git dir path in repo

main
Eric Amodio 1 ano atrás
pai
commit
c3014f48fc
1 arquivos alterados com 10 adições e 2 exclusões
  1. +10
    -2
      src/git/models/repository.ts

+ 10
- 2
src/git/models/repository.ts Ver arquivo

@ -20,7 +20,7 @@ import { updateRecordValue } from '../../system/object';
import { basename, normalizePath } from '../../system/path';
import { md5 } from '../../system/string';
import { runGitCommandInTerminal } from '../../terminal';
import type { GitProviderDescriptor, GitRepositoryCaches } from '../gitProvider';
import type { GitDir, GitProviderDescriptor, GitRepositoryCaches } from '../gitProvider';
import type { RemoteProviders } from '../remotes/remoteProviders';
import { loadRemoteProviders } from '../remotes/remoteProviders';
import type { RichRemoteProvider } from '../remotes/richRemoteProvider';
@ -289,7 +289,7 @@ export class Repository implements Disposable {
return watcher;
}
const gitDir = await this.container.git.getGitDir(this.path);
const gitDir = await this.getGitDir();
if (gitDir != null) {
if (gitDir?.commonUri == null) {
watch.call(
@ -596,6 +596,14 @@ export class Repository implements Disposable {
return this.container.git.getContributors(this.path, options);
}
private _gitDir: Promise<GitDir | undefined> | undefined;
private getGitDir(): Promise<GitDir | undefined> {
if (this._gitDir == null) {
this._gitDir = this.container.git.getGitDir(this.path);
}
return this._gitDir;
}
private _lastFetched: number | undefined;
@gate()
async getLastFetched(): Promise<number> {

Carregando…
Cancelar
Salvar