public class MergeConfig
extends java.lang.Object
Modifier and Type | Class and Description |
---|---|
private static class |
MergeConfig.MergeConfigSectionParser |
Modifier and Type | Field and Description |
---|---|
private boolean |
commit |
private MergeCommand.FastForwardMode |
fastForwardMode |
private boolean |
squash |
Modifier | Constructor and Description |
---|---|
private |
MergeConfig() |
private |
MergeConfig(java.lang.String branch,
Config config) |
Modifier and Type | Method and Description |
---|---|
static MergeConfig |
getConfigForCurrentBranch(Repository repo)
Get merge configuration for the current branch of the repository
|
MergeCommand.FastForwardMode |
getFastForwardMode()
Get the fast forward mode configured for this branch
|
private static MergeCommand.FastForwardMode |
getFastForwardMode(Config config,
java.lang.String[] mergeOptions) |
private static java.lang.String[] |
getMergeOptions(java.lang.String branch,
Config config) |
static Config.SectionParser<MergeConfig> |
getParser(java.lang.String branch)
Get a parser for use with
Config.get(SectionParser) |
boolean |
isCommit()
Whether
--no-commit option is not set. |
private static boolean |
isMergeConfigOptionSet(java.lang.String optionToLookFor,
java.lang.String[] mergeOptions) |
boolean |
isSquash()
Whether merges into this branch are configured to be squash merges, false
otherwise
|
private final MergeCommand.FastForwardMode fastForwardMode
private final boolean squash
private final boolean commit
private MergeConfig(java.lang.String branch, Config config)
private MergeConfig()
public static MergeConfig getConfigForCurrentBranch(Repository repo)
repo
- a Repository
object.public static final Config.SectionParser<MergeConfig> getParser(java.lang.String branch)
Config.get(SectionParser)
branch
- short branch name to get the configuration for, as returned
e.g. by Repository.getBranch()
Config.get(SectionParser)
public MergeCommand.FastForwardMode getFastForwardMode()
public boolean isSquash()
public boolean isCommit()
--no-commit
option is not set.false
if --no-commit is configured for this branch,
true
otherwise (even if --squash is configured)private static MergeCommand.FastForwardMode getFastForwardMode(Config config, java.lang.String[] mergeOptions)
private static boolean isMergeConfigOptionSet(java.lang.String optionToLookFor, java.lang.String[] mergeOptions)
private static java.lang.String[] getMergeOptions(java.lang.String branch, Config config)