T - The return type of the call() methodpublic abstract class AbstractGitFlowCommand<C,T> extends Object implements Callable<T>, JGitFlowCommand
Most commands should extend this class as it provides common helper methods and methods to ensure valid state.
| Modifier and Type | Field and Description |
|---|---|
protected GitFlowConfiguration |
gfConfig |
protected org.eclipse.jgit.api.Git |
git |
protected JGitFlowReporter |
reporter |
protected RequirementHelper |
requirementHelper |
| Modifier | Constructor and Description |
|---|---|
protected |
AbstractGitFlowCommand(String branchName,
org.eclipse.jgit.api.Git git,
GitFlowConfiguration gfConfig) |
| Modifier and Type | Method and Description |
|---|---|
protected void |
doFetchIfNeeded(JGitFlowExtension fetchingExtension) |
protected void |
doPushIfNeeded(JGitFlowExtension pushExtension,
boolean includeTags,
String... branchesToPush) |
protected RequirementHelper |
enforcer() |
protected void |
ensureLocalBranchesNotBehindRemotes(String... branchesToTest) |
String |
getBranchName() |
protected abstract String |
getCommandName() |
String |
getScmMessagePrefix() |
String |
getScmMessageSuffix() |
boolean |
isAllowUntracked() |
boolean |
isFetch() |
boolean |
isPush() |
protected String |
runBeforeAndGetPrefixedBranchName(Iterable<ExtensionCommand> before,
JGitFlowConstants.PREFIXES prefix) |
protected void |
runExtensionCommands(Iterable<ExtensionCommand> commands) |
C |
setAllowUntracked(boolean allow) |
C |
setFetch(boolean fetch)
Set whether to perform a git fetch of the remote branches before doing the merge
|
C |
setPush(boolean push)
Set whether to push the changes to the remote repository
|
C |
setScmMessagePrefix(String scmMessagePrefix) |
C |
setScmMessageSuffix(String scmMessageSuffix) |
protected final org.eclipse.jgit.api.Git git
protected final GitFlowConfiguration gfConfig
protected final JGitFlowReporter reporter
protected final RequirementHelper requirementHelper
protected AbstractGitFlowCommand(String branchName, org.eclipse.jgit.api.Git git, GitFlowConfiguration gfConfig)
protected void doFetchIfNeeded(JGitFlowExtension fetchingExtension) throws org.eclipse.jgit.api.errors.GitAPIException, JGitFlowGitAPIException, JGitFlowExtensionException
org.eclipse.jgit.api.errors.GitAPIExceptionJGitFlowGitAPIExceptionJGitFlowExtensionExceptionprotected void doPushIfNeeded(JGitFlowExtension pushExtension, boolean includeTags, String... branchesToPush) throws org.eclipse.jgit.api.errors.GitAPIException, JGitFlowGitAPIException, JGitFlowExtensionException
org.eclipse.jgit.api.errors.GitAPIExceptionJGitFlowGitAPIExceptionJGitFlowExtensionExceptionprotected String runBeforeAndGetPrefixedBranchName(Iterable<ExtensionCommand> before, JGitFlowConstants.PREFIXES prefix) throws JGitFlowExtensionException
JGitFlowExtensionExceptionprotected void ensureLocalBranchesNotBehindRemotes(String... branchesToTest) throws JGitFlowGitAPIException, BranchOutOfDateException, JGitFlowIOException
public C setAllowUntracked(boolean allow)
setAllowUntracked in interface JGitFlowCommandpublic boolean isAllowUntracked()
isAllowUntracked in interface JGitFlowCommandpublic String getScmMessagePrefix()
getScmMessagePrefix in interface JGitFlowCommandpublic C setScmMessagePrefix(String scmMessagePrefix)
setScmMessagePrefix in interface JGitFlowCommandpublic String getScmMessageSuffix()
getScmMessageSuffix in interface JGitFlowCommandpublic C setScmMessageSuffix(String scmMessageSuffix)
setScmMessageSuffix in interface JGitFlowCommandpublic C setFetch(boolean fetch)
setFetch in interface JGitFlowCommandfetch - true to do the fetch, false(default) otherwisethispublic boolean isFetch()
isFetch in interface JGitFlowCommandpublic C setPush(boolean push)
setPush in interface JGitFlowCommandpush - true to do the push, false(default) otherwisethispublic boolean isPush()
isPush in interface JGitFlowCommandpublic String getBranchName()
getBranchName in interface JGitFlowCommandprotected abstract String getCommandName()
protected void runExtensionCommands(Iterable<ExtensionCommand> commands) throws JGitFlowExtensionException
JGitFlowExtensionExceptionprotected RequirementHelper enforcer()
Copyright © 2023 DV Bern AG. All rights reserved.