private void updateSslVerifyUser(boolean value) { FileBasedConfig userConfig = SystemReader.getInstance() .openUserConfig(null, FS.DETECTED); try { userConfig.load(); updateSslVerify(userConfig, value); } catch (IOException | ConfigInvalidException e) { // Log it, but otherwise ignore here. LOG.error(MessageFormat.format(JGitText.get().userConfigFileInvalid, userConfig.getFile().getAbsolutePath(), e)); } }
/** * Creates a {@link org.eclipse.jgit.transport.HttpConfig} that reads values * solely from the user config. * * @param uri * to get the configuration values for */ public HttpConfig(URIish uri) { FileBasedConfig userConfig = SystemReader.getInstance() .openUserConfig(null, FS.DETECTED); try { userConfig.load(); } catch (IOException | ConfigInvalidException e) { // Log it and then work with default values. LOG.error(MessageFormat.format(JGitText.get().userConfigFileInvalid, userConfig.getFile().getAbsolutePath(), e)); init(new Config(), uri); return; } init(userConfig, uri); }
private void determineAtomicFileCreationSupport() { // @TODO: enhance SystemReader to support this without copying code AtomicFileCreation ret = getAtomicFileCreationSupportOption( SystemReader.getInstance().openUserConfig(null, this)); if (ret == AtomicFileCreation.UNDEFINED && StringUtils.isEmptyOrNull(SystemReader.getInstance() .getenv(Constants.GIT_CONFIG_NOSYSTEM_KEY))) { ret = getAtomicFileCreationSupportOption( SystemReader.getInstance().openSystemConfig(null, this)); } supportsAtomicCreateNewFile = ret; }
userConfig = SystemReader.getInstance().openUserConfig(systemConfig, FS.DETECTED); Errors.log().run(userConfig::load);
userConfig = SystemReader.getInstance().openUserConfig(systemConfig, getFS()); repoConfig = new FileBasedConfig(userConfig, getFS().resolve(
private StoredConfig loadUserConfig() throws IOException { FileBasedConfig c = SystemReader.getInstance().openUserConfig(null, FS.DETECTED); try { c.load(); } catch (ConfigInvalidException e1) { throw new IOException(MessageFormat .format(LfsText.get().userConfigInvalid, c.getFile() .getAbsolutePath(), e1), e1); } return c; }
private void updateSslVerifyUser(boolean value) { FileBasedConfig userConfig = SystemReader.getInstance() .openUserConfig(null, FS.DETECTED); try { userConfig.load(); updateSslVerify(userConfig, value); } catch (IOException | ConfigInvalidException e) { // Log it, but otherwise ignore here. LOG.error(MessageFormat.format(JGitText.get().userConfigFileInvalid, userConfig.getFile().getAbsolutePath(), e)); } }
private static StoredConfig loadUserScopedConfig() { StoredConfig c = SystemReader.getInstance().openUserConfig(null, FS.DETECTED); try { c.load(); } catch (IOException e) { Activator.handleError(e.getMessage(), e, true); } catch (ConfigInvalidException e) { Activator.handleError(e.getMessage(), e, true); } return c; }
/** * Creates a {@link org.eclipse.jgit.transport.HttpConfig} that reads values * solely from the user config. * * @param uri * to get the configuration values for */ public HttpConfig(URIish uri) { FileBasedConfig userConfig = SystemReader.getInstance() .openUserConfig(null, FS.DETECTED); try { userConfig.load(); } catch (IOException | ConfigInvalidException e) { // Log it and then work with default values. LOG.error(MessageFormat.format(JGitText.get().userConfigFileInvalid, userConfig.getFile().getAbsolutePath(), e)); init(new Config(), uri); return; } init(userConfig, uri); }
public void init(IWorkbench workbench) { if (sysConfig == null) sysConfig = SystemReader.getInstance().openSystemConfig(null, FS.DETECTED); if (userConfig == null) userConfig = SystemReader.getInstance().openUserConfig(null, FS.DETECTED); // no inherit here! if (repositories == null) { repositories = new ArrayList<Repository>(); List<String> repoPaths = Activator.getDefault().getRepositoryUtil().getConfiguredRepositories(); RepositoryCache repositoryCache = org.eclipse.egit.core.Activator.getDefault().getRepositoryCache(); for (String repoPath : repoPaths) { File gitDir = new File(repoPath); if (!gitDir.exists()) continue; try { repositories.add(repositoryCache.lookupRepository(gitDir)); } catch (IOException e) { continue; } } sortRepositoriesByName(); } }
private void determineAtomicFileCreationSupport() { // @TODO: enhance SystemReader to support this without copying code AtomicFileCreation ret = getAtomicFileCreationSupportOption( SystemReader.getInstance().openUserConfig(null, this)); if (ret == AtomicFileCreation.UNDEFINED && StringUtils.isEmptyOrNull(SystemReader.getInstance() .getenv(Constants.GIT_CONFIG_NOSYSTEM_KEY))) { ret = getAtomicFileCreationSupportOption( SystemReader.getInstance().openSystemConfig(null, this)); } supportsAtomicCreateNewFile = ret; }
userConfig = SystemReader.getInstance().openUserConfig(systemConfig, FS.DETECTED); Errors.log().run(userConfig::load);
userConfig = SystemReader.getInstance().openUserConfig(systemConfig, getFS()); repoConfig = new FileBasedConfig(userConfig, getFS().resolve(
userConfig = SystemReader.getInstance().openUserConfig(systemConfig, getFS()); repoConfig = new FileBasedConfig(userConfig, getFS().resolve(
private void list() throws IOException, ConfigInvalidException { final FS fs = getRepository().getFS(); if (configFile != null) { list(new FileBasedConfig(configFile, fs)); return; } if (system || (isListAll() && StringUtils.isEmptyOrNull(SystemReader .getInstance() .getenv(Constants.GIT_CONFIG_NOSYSTEM_KEY)))) list(SystemReader.getInstance().openSystemConfig(null, fs)); if (global || isListAll()) list(SystemReader.getInstance().openUserConfig(null, fs)); if (local || isListAll()) list(new FileBasedConfig(fs.resolve(getRepository().getDirectory(), Constants.CONFIG), fs)); }
userHomeConfig = SystemReader.getInstance().openUserConfig(systemConfig, FS.DETECTED);