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.GitAPIException
JGitFlowGitAPIException
JGitFlowExtensionException
protected void doPushIfNeeded(JGitFlowExtension pushExtension, boolean includeTags, String... branchesToPush) throws org.eclipse.jgit.api.errors.GitAPIException, JGitFlowGitAPIException, JGitFlowExtensionException
org.eclipse.jgit.api.errors.GitAPIException
JGitFlowGitAPIException
JGitFlowExtensionException
protected String runBeforeAndGetPrefixedBranchName(Iterable<ExtensionCommand> before, JGitFlowConstants.PREFIXES prefix) throws JGitFlowExtensionException
JGitFlowExtensionException
protected void ensureLocalBranchesNotBehindRemotes(String... branchesToTest) throws JGitFlowGitAPIException, BranchOutOfDateException, JGitFlowIOException
public C setAllowUntracked(boolean allow)
setAllowUntracked
in interface JGitFlowCommand
public boolean isAllowUntracked()
isAllowUntracked
in interface JGitFlowCommand
public String getScmMessagePrefix()
getScmMessagePrefix
in interface JGitFlowCommand
public C setScmMessagePrefix(String scmMessagePrefix)
setScmMessagePrefix
in interface JGitFlowCommand
public String getScmMessageSuffix()
getScmMessageSuffix
in interface JGitFlowCommand
public C setScmMessageSuffix(String scmMessageSuffix)
setScmMessageSuffix
in interface JGitFlowCommand
public C setFetch(boolean fetch)
setFetch
in interface JGitFlowCommand
fetch
- true
to do the fetch, false
(default) otherwisethis
public boolean isFetch()
isFetch
in interface JGitFlowCommand
public C setPush(boolean push)
setPush
in interface JGitFlowCommand
push
- true
to do the push, false
(default) otherwisethis
public boolean isPush()
isPush
in interface JGitFlowCommand
public String getBranchName()
getBranchName
in interface JGitFlowCommand
protected abstract String getCommandName()
protected void runExtensionCommands(Iterable<ExtensionCommand> commands) throws JGitFlowExtensionException
JGitFlowExtensionException
protected RequirementHelper enforcer()
Copyright © 2017 Atlassian. All rights reserved.