private WorkingTreeOptions(Config rc) { fileMode = rc.getBoolean(ConfigConstants.CONFIG_CORE_SECTION, ConfigConstants.CONFIG_KEY_FILEMODE, true); autoCRLF = rc.getEnum(ConfigConstants.CONFIG_CORE_SECTION, null, ConfigConstants.CONFIG_KEY_AUTOCRLF, AutoCRLF.FALSE); eol = rc.getEnum(ConfigConstants.CONFIG_CORE_SECTION, null, ConfigConstants.CONFIG_KEY_EOL, EOL.NATIVE); checkStat = rc.getEnum(ConfigConstants.CONFIG_CORE_SECTION, null, ConfigConstants.CONFIG_KEY_CHECKSTAT, CheckStat.DEFAULT); symlinks = rc.getEnum(ConfigConstants.CONFIG_CORE_SECTION, null, ConfigConstants.CONFIG_KEY_SYMLINKS, SymLinks.TRUE); hideDotFiles = rc.getEnum(ConfigConstants.CONFIG_CORE_SECTION, null, ConfigConstants.CONFIG_KEY_HIDEDOTFILES, HideDotFiles.DOTGITONLY); dirNoGitLinks = rc.getBoolean(ConfigConstants.CONFIG_CORE_SECTION, null, ConfigConstants.CONFIG_KEY_DIRNOGITLINKS, false); }
/** * Retrieves the config value of gpg.format. * * @return the {@link org.eclipse.jgit.lib.GpgConfig.GpgFormat} */ public GpgFormat getKeyFormat() { return config.getEnum(GpgFormat.values(), ConfigConstants.CONFIG_GPG_SECTION, null, ConfigConstants.CONFIG_KEY_FORMAT, GpgFormat.OPENPGP); }
/** * Retrieves the config value of branch.[name].rebase. * * @return the {@link org.eclipse.jgit.lib.BranchConfig.BranchRebaseMode} * @since 4.5 */ public BranchRebaseMode getRebaseMode() { return config.getEnum(BranchRebaseMode.values(), ConfigConstants.CONFIG_BRANCH_SECTION, branchName, ConfigConstants.CONFIG_KEY_REBASE, BranchRebaseMode.NONE); }
/** * Update the configuration from a config block. * * @param cfg * configuration to read. * @param name * of the replica being configured. * @return {@code this} */ public ReplicaConfig fromConfig(Config cfg, String name) { participation = cfg.getEnum( CONFIG_KEY_REMOTE, name, CONFIG_KEY_TYPE, participation); commitMethod = cfg.getEnum( CONFIG_KEY_REMOTE, name, CONFIG_KEY_COMMIT, commitMethod); commitSpeed = cfg.getEnum( CONFIG_KEY_REMOTE, name, CONFIG_KEY_SPEED, commitSpeed); minRetry = getMillis(cfg, name, "ketch-minRetry", minRetry); //$NON-NLS-1$ maxRetry = getMillis(cfg, name, "ketch-maxRetry", maxRetry); //$NON-NLS-1$ return this; }
private Runtime(List<AttributesRule> infoRules, @Nullable File workTree, Config config, List<AttributesRule> globalRules) { this.infoRules = Objects.requireNonNull(infoRules); this.workTree = workTree; this.defaultEnding = fromEol(config.getEnum(ConfigConstants.CONFIG_CORE_SECTION, null, ConfigConstants.CONFIG_KEY_EOL, EOL.NATIVE)).str(); this.globalRules = Objects.requireNonNull(globalRules); }
/** * Reads the rebase mode to use for a pull command from the repository * configuration. This is the value defined for the configurations * {@code branch.[branchName].rebase}, or,if not set, {@code pull.rebase}. * If neither is set, yields * {@link org.eclipse.jgit.lib.BranchConfig.BranchRebaseMode#NONE}. * * @param branchName * name of the local branch * @param config * the {@link org.eclipse.jgit.lib.Config} to read the value from * @return the {@link org.eclipse.jgit.lib.BranchConfig.BranchRebaseMode} * @since 4.5 */ public static BranchRebaseMode getRebaseMode(String branchName, Config config) { BranchRebaseMode mode = config.getEnum(BranchRebaseMode.values(), ConfigConstants.CONFIG_BRANCH_SECTION, branchName, ConfigConstants.CONFIG_KEY_REBASE, null); if (mode == null) { mode = config.getEnum(BranchRebaseMode.values(), ConfigConstants.CONFIG_PULL_SECTION, null, ConfigConstants.CONFIG_KEY_REBASE, BranchRebaseMode.NONE); } return mode; }
private static MergeAlgorithm getMergeAlgorithm(Config config) { SupportedAlgorithm diffAlg = config.getEnum( CONFIG_DIFF_SECTION, null, CONFIG_KEY_ALGORITHM, HISTOGRAM); return new MergeAlgorithm(DiffAlgorithm.getAlgorithm(diffAlg)); }
private FastForwardMode getFastForwardMode() { if (fastForwardMode != null) { return fastForwardMode; } Config config = repo.getConfig(); Merge ffMode = config.getEnum(Merge.values(), ConfigConstants.CONFIG_PULL_SECTION, null, ConfigConstants.CONFIG_KEY_FF, null); return ffMode != null ? FastForwardMode.valueOf(ffMode) : null; } }
private static FastForwardMode getFastForwardMode(Config config, String[] mergeOptions) { for (String option : mergeOptions) { for (FastForwardMode mode : FastForwardMode.values()) if (mode.matchConfigValue(option)) return mode; } FastForwardMode ffmode = FastForwardMode.valueOf(config.getEnum( ConfigConstants.CONFIG_KEY_MERGE, null, ConfigConstants.CONFIG_KEY_FF, FastForwardMode.Merge.TRUE)); return ffmode; }
/** * Get the configured ignore field for the current entry. This will be the * value from the .gitmodules file in the current repository's working tree. * * @return ignore value * @throws org.eclipse.jgit.errors.ConfigInvalidException * @throws java.io.IOException * @since 3.6 */ public IgnoreSubmoduleMode getModulesIgnore() throws IOException, ConfigInvalidException { lazyLoadModulesConfig(); return modulesConfig.getEnum(IgnoreSubmoduleMode.values(), ConfigConstants.CONFIG_SUBMODULE_SECTION, getModuleName(), ConfigConstants.CONFIG_KEY_IGNORE, IgnoreSubmoduleMode.NONE); }
1 * 1024 * 1024); boolean sslVerifyFlag = config.getBoolean(HTTP, SSL_VERIFY_KEY, true); HttpRedirectMode followRedirectsMode = config.getEnum( HttpRedirectMode.values(), HTTP, null, FOLLOW_REDIRECTS_KEY, HttpRedirectMode.INITIAL); sslVerifyFlag = config.getBoolean(HTTP, match, SSL_VERIFY_KEY, sslVerifyFlag); followRedirectsMode = config.getEnum(HttpRedirectMode.values(), HTTP, match, FOLLOW_REDIRECTS_KEY, followRedirectsMode); int newMaxRedirects = config.getInt(HTTP, match, MAX_REDIRECTS_KEY,
private void setReader(ObjectReader reader, Config cfg, boolean closeReader) { close(); this.closeReader = closeReader; this.reader = reader; this.diffCfg = cfg.get(DiffConfig.KEY); ContentSource cs = ContentSource.create(reader); source = new ContentSource.Pair(cs, cs); if (diffCfg.isNoPrefix()) { setOldPrefix(""); //$NON-NLS-1$ setNewPrefix(""); //$NON-NLS-1$ } setDetectRenames(diffCfg.isRenameDetectionEnabled()); diffAlgorithm = DiffAlgorithm.getAlgorithm(cfg.getEnum( ConfigConstants.CONFIG_DIFF_SECTION, null, ConfigConstants.CONFIG_KEY_ALGORITHM, SupportedAlgorithm.HISTOGRAM)); }
switch (rc.getEnum(FSCK, null, key, FsckMode.ERROR)) { case ERROR: ignore.remove(id);
/** * Retrieves the config value of branch.[name].rebase. * * @return the {@link BranchRebaseMode} * @since 4.5 */ public BranchRebaseMode getRebaseMode() { return config.getEnum(BranchRebaseMode.values(), ConfigConstants.CONFIG_BRANCH_SECTION, branchName, ConfigConstants.CONFIG_KEY_REBASE, BranchRebaseMode.NONE); }
public static CoreEol getConfigValue(final Config gitConfig) { return gitConfig.getEnum(CoreEol.values(), ConfigConstants.CONFIG_CORE_SECTION, null, CONFIG_KEY_EOL, DEFAULT); }
public static CoreEol getConfigValue(final Config gitConfig) { return gitConfig.getEnum(CoreEol.values(), ConfigConstants.CONFIG_CORE_SECTION, null, CONFIG_KEY_EOL, DEFAULT); }
private Runtime(List<AttributesRule> infoRules, @Nullable File workTree, Config config, List<AttributesRule> globalRules) { this.infoRules = Objects.requireNonNull(infoRules); this.workTree = workTree; this.defaultEnding = fromEol(config.getEnum(ConfigConstants.CONFIG_CORE_SECTION, null, ConfigConstants.CONFIG_KEY_EOL, EOL.NATIVE)).str(); this.globalRules = Objects.requireNonNull(globalRules); }
private static FastForwardMode getFastForwardMode(Config config, String[] mergeOptions) { for (String option : mergeOptions) { for (FastForwardMode mode : FastForwardMode.values()) if (mode.matchConfigValue(option)) return mode; } FastForwardMode ffmode = FastForwardMode.valueOf(config.getEnum( ConfigConstants.CONFIG_KEY_MERGE, null, ConfigConstants.CONFIG_KEY_FF, FastForwardMode.Merge.TRUE)); return ffmode; }
private static FastForwardMode getFastForwardMode(Config config, String[] mergeOptions) { for (String option : mergeOptions) { for (FastForwardMode mode : FastForwardMode.values()) if (mode.matchConfigValue(option)) return mode; } FastForwardMode ffmode = FastForwardMode.valueOf(config.getEnum( ConfigConstants.CONFIG_KEY_MERGE, null, ConfigConstants.CONFIG_KEY_FF, FastForwardMode.Merge.TRUE)); return ffmode; }
private FastForwardMode getFastForwardMode() { if (fastForwardMode != null) { return fastForwardMode; } Config config = repo.getConfig(); Merge ffMode = config.getEnum(Merge.values(), ConfigConstants.CONFIG_PULL_SECTION, null, ConfigConstants.CONFIG_KEY_FF, null); return ffMode != null ? FastForwardMode.valueOf(ffMode) : null; } }