Eric Amodio há 7 anos
ascendente
cometimento
db4b53f5c7
2 ficheiros alterados com 7 adições e 29 eliminações
  1. +1
    -3
      src/git/models/repository.ts
  2. +6
    -26
      src/gitService.ts

+ 1
- 3
src/git/models/repository.ts Ver ficheiro

@ -126,9 +126,7 @@ export class Repository extends Disposable {
const section = configuration.name('remotes').value;
if (initializing || configuration.changed(e, section, this.folder.uri)) {
// Can't reset the provider map here because of https://github.com/Microsoft/vscode/issues/38229
// this._providerMap = RemoteProviderFactory.createMap(configuration.get<IRemotesConfig[] | null | undefined>(section, this.folder.uri));
this._providerMap = undefined;
this._providerMap = RemoteProviderFactory.createMap(configuration.get<IRemotesConfig[] | null | undefined>(section, this.folder.uri));
if (!initializing) {
this._remotes = undefined;

+ 6
- 26
src/gitService.ts Ver ficheiro

@ -281,34 +281,14 @@ export class GitService extends Disposable {
repositories.push(new Repository(folder, rootPath, true, this, anyRepoChangedFn, this._suspended));
}
// Can remove this try/catch once https://github.com/Microsoft/vscode/issues/38229 is fixed
let depth;
try {
depth = configuration.get<number>(configuration.name('advanced')('repositorySearchDepth').value, folderUri);
}
catch (ex) {
Logger.error(ex);
depth = configuration.get<number>(configuration.name('advanced')('repositorySearchDepth').value, null);
}
const depth = configuration.get<number>(configuration.name('advanced')('repositorySearchDepth').value, folderUri);
if (depth <= 0) return repositories;
// Can remove this try/catch once https://github.com/Microsoft/vscode/issues/38229 is fixed
let excludes = {};
try {
// Get any specified excludes -- this is a total hack, but works for some simple cases and something is better than nothing :)
excludes = {
...workspace.getConfiguration('files', folderUri).get<{ [key: string]: boolean }>('exclude', {}),
...workspace.getConfiguration('search', folderUri).get<{ [key: string]: boolean }>('exclude', {})
};
}
catch (ex) {
Logger.error(ex);
excludes = {
...workspace.getConfiguration('files', null!).get<{ [key: string]: boolean }>('exclude', {}),
...workspace.getConfiguration('search', null!).get<{ [key: string]: boolean }>('exclude', {})
};
}
// Get any specified excludes -- this is a total hack, but works for some simple cases and something is better than nothing :)
let excludes = {
...workspace.getConfiguration('files', folderUri).get<{ [key: string]: boolean }>('exclude', {}),
...workspace.getConfiguration('search', folderUri).get<{ [key: string]: boolean }>('exclude', {})
};
const excludedPaths = [...Iterables.filterMap(Objects.entries(excludes), ([key, value]) => {
if (!value) return undefined;

Carregando…
Cancelar
Guardar