Package org.eclipse.jgit.merge
Class MergeConfig
- java.lang.Object
-
- org.eclipse.jgit.merge.MergeConfig
-
public class MergeConfig extends java.lang.Object
Holds configuration for merging into a given branch- Since:
- 3.3
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description private static class
MergeConfig.MergeConfigSectionParser
-
Field Summary
Fields Modifier and Type Field Description private boolean
commit
private MergeCommand.FastForwardMode
fastForwardMode
private boolean
squash
-
Constructor Summary
Constructors Modifier Constructor Description private
MergeConfig()
private
MergeConfig(java.lang.String branch, Config config)
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static MergeConfig
getConfigForCurrentBranch(Repository repo)
Get merge configuration for the current branch of the repositoryMergeCommand.FastForwardMode
getFastForwardMode()
Get the fast forward mode configured for this branchprivate 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 withConfig.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
-
-
-
Field Detail
-
fastForwardMode
private final MergeCommand.FastForwardMode fastForwardMode
-
squash
private final boolean squash
-
commit
private final boolean commit
-
-
Constructor Detail
-
MergeConfig
private MergeConfig(java.lang.String branch, Config config)
-
MergeConfig
private MergeConfig()
-
-
Method Detail
-
getConfigForCurrentBranch
public static MergeConfig getConfigForCurrentBranch(Repository repo)
Get merge configuration for the current branch of the repository- Parameters:
repo
- aRepository
object.- Returns:
- merge configuration for the current branch of the repository
-
getParser
public static final Config.SectionParser<MergeConfig> getParser(java.lang.String branch)
Get a parser for use withConfig.get(SectionParser)
- Parameters:
branch
- short branch name to get the configuration for, as returned e.g. byRepository.getBranch()
- Returns:
- a parser for use with
Config.get(SectionParser)
-
getFastForwardMode
public MergeCommand.FastForwardMode getFastForwardMode()
Get the fast forward mode configured for this branch- Returns:
- the fast forward mode configured for this branch
-
isSquash
public boolean isSquash()
Whether merges into this branch are configured to be squash merges, false otherwise- Returns:
- true if merges into this branch are configured to be squash merges, false otherwise
-
isCommit
public boolean isCommit()
Whether--no-commit
option is not set.- Returns:
false
if --no-commit is configured for this branch,true
otherwise (even if --squash is configured)
-
getFastForwardMode
private static MergeCommand.FastForwardMode getFastForwardMode(Config config, java.lang.String[] mergeOptions)
-
isMergeConfigOptionSet
private static boolean isMergeConfigOptionSet(java.lang.String optionToLookFor, java.lang.String[] mergeOptions)
-
getMergeOptions
private static java.lang.String[] getMergeOptions(java.lang.String branch, Config config)
-
-