/** * Get merge configuration for the current branch of the repository * * @param repo * a {@link org.eclipse.jgit.lib.Repository} object. * @return merge configuration for the current branch of the repository */ public static MergeConfig getConfigForCurrentBranch(Repository repo) { try { String branch = repo.getBranch(); if (branch != null) return repo.getConfig().get(getParser(branch)); } catch (IOException e) { // ignore } // use defaults if branch can't be determined return new MergeConfig(); }
/** * Use values from the configuation if they have not been explicitly defined * via the setters */ private void fallBackToConfiguration() { MergeConfig config = MergeConfig.getConfigForCurrentBranch(repo); if (squash == null) squash = Boolean.valueOf(config.isSquash()); if (commit == null) commit = Boolean.valueOf(config.isCommit()); if (fastForwardMode == null) fastForwardMode = config.getFastForwardMode(); }
private MergeConfig(String branch, Config config) { String[] mergeOptions = getMergeOptions(branch, config); fastForwardMode = getFastForwardMode(config, mergeOptions); squash = isMergeConfigOptionSet("--squash", mergeOptions); //$NON-NLS-1$ commit = !isMergeConfigOptionSet("--no-commit", mergeOptions); //$NON-NLS-1$ }
@Override public MergeConfig parse(Config cfg) { return new MergeConfig(branch, cfg); }
@Override public MergeConfig parse(Config cfg) { return new MergeConfig(branch, cfg); }
/** * Use values from the configuation if they have not been explicitly defined * via the setters */ private void fallBackToConfiguration() { MergeConfig config = MergeConfig.getConfigForCurrentBranch(repo); if (squash == null) squash = Boolean.valueOf(config.isSquash()); if (commit == null) commit = Boolean.valueOf(config.isCommit()); if (fastForwardMode == null) fastForwardMode = config.getFastForwardMode(); }
private MergeConfig(String branch, Config config) { String[] mergeOptions = getMergeOptions(branch, config); fastForwardMode = getFastForwardMode(config, mergeOptions); squash = isMergeConfigOptionSet("--squash", mergeOptions); //$NON-NLS-1$ commit = !isMergeConfigOptionSet("--no-commit", mergeOptions); //$NON-NLS-1$ }
/** * @param repo * @return merge configuration for the current branch of the repository */ public static MergeConfig getConfigForCurrentBranch(Repository repo) { try { String branch = repo.getBranch(); if (branch != null) return repo.getConfig().get(getParser(branch)); } catch (IOException e) { // ignore } // use defaults if branch can't be determined return new MergeConfig(); }
public MergeConfig parse(Config cfg) { return new MergeConfig(branch, cfg); }
/** * Use values from the configuation if they have not been explicitly defined * via the setters */ private void fallBackToConfiguration() { MergeConfig config = MergeConfig.getConfigForCurrentBranch(repo); if (squash == null) squash = Boolean.valueOf(config.isSquash()); if (commit == null) commit = Boolean.valueOf(config.isCommit()); if (fastForwardMode == null) fastForwardMode = config.getFastForwardMode(); }
private MergeConfig(String branch, Config config) { String[] mergeOptions = getMergeOptions(branch, config); fastForwardMode = getFastForwardMode(config, mergeOptions); squash = isMergeConfigOptionSet("--squash", mergeOptions); //$NON-NLS-1$ commit = !isMergeConfigOptionSet("--no-commit", mergeOptions); //$NON-NLS-1$ }
/** * Get merge configuration for the current branch of the repository * * @param repo * a {@link org.eclipse.jgit.lib.Repository} object. * @return merge configuration for the current branch of the repository */ public static MergeConfig getConfigForCurrentBranch(Repository repo) { try { String branch = repo.getBranch(); if (branch != null) return repo.getConfig().get(getParser(branch)); } catch (IOException e) { // ignore } // use defaults if branch can't be determined return new MergeConfig(); }