Package org.eclipse.jgit.merge
Class MergeConfig
java.lang.Object
org.eclipse.jgit.merge.MergeConfig
Holds configuration for merging into a given branch
- Since:
- 3.3
-
Nested Class Summary
Nested Classes -
Field Summary
FieldsModifier and TypeFieldDescriptionprivate final booleanprivate final MergeCommand.FastForwardModeprivate final boolean -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic MergeConfigGet merge configuration for the current branch of the repositoryGet the fast forward mode configured for this branchprivate static MergeCommand.FastForwardModegetFastForwardMode(Config config, String[] mergeOptions) private static String[]getMergeOptions(String branch, Config config) static final Config.SectionParser<MergeConfig>Get a parser for use withConfig.get(SectionParser)booleanisCommit()Whether--no-commitoption is not set.private static booleanisMergeConfigOptionSet(String optionToLookFor, String[] mergeOptions) booleanisSquash()Whether merges into this branch are configured to be squash merges, false otherwise
-
Field Details
-
fastForwardMode
-
squash
private final boolean squash -
commit
private final boolean commit
-
-
Constructor Details
-
MergeConfig
-
MergeConfig
private MergeConfig()
-
-
Method Details
-
getConfigForCurrentBranch
Get merge configuration for the current branch of the repository- Parameters:
repo- aRepositoryobject.- Returns:
- merge configuration for the current branch of the repository
-
getParser
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
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-commitoption is not set.- Returns:
falseif --no-commit is configured for this branch,trueotherwise (even if --squash is configured)
-
getFastForwardMode
private static MergeCommand.FastForwardMode getFastForwardMode(Config config, String[] mergeOptions) -
isMergeConfigOptionSet
-
getMergeOptions
-