Class MergeConfig


  • public class MergeConfig
    extends java.lang.Object
    Holds configuration for merging into a given branch
    Since:
    3.3
    • Field Detail

      • 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 - a Repository object.
        Returns:
        merge configuration for the current branch of the repository
      • 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)
      • 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)