public class RequirementHelper extends Object
| Modifier and Type | Field and Description |
|---|---|
protected String |
commandName |
protected GitFlowConfiguration |
gfConfig |
protected org.eclipse.jgit.api.Git |
git |
protected JGitFlowReporter |
reporter |
| Constructor and Description |
|---|
RequirementHelper(org.eclipse.jgit.api.Git git,
GitFlowConfiguration gfConfig,
String commandName) |
| Modifier and Type | Method and Description |
|---|---|
void |
requireCleanWorkingTree(boolean allowUntracked)
Requires that the local working tree has no un-committed changes
|
void |
requireCommitOnBranch(org.eclipse.jgit.revwalk.RevCommit commit,
String branch)
Requires that a local branch contains the given commit
|
void |
requireGitFlowInitialized()
Requires that git flow has been initialized for the project represented by the internal {Git} instance
|
void |
requireLocalBranchAbsent(String branch)
Requires that a local branch with the given name does not yet exist
|
void |
requireLocalBranchExists(String branch)
Requires that a local branch with the given name exists
|
void |
requireLocalBranchNotBehindRemote(String branch)
Requires that the local branch with the given name is not behind a remote brach with the same name
|
void |
requireNoExistingHotfixBranches()
Requires that no hotfix branches already exist
|
void |
requireNoExistingReleaseBranches()
Requires that no release branches already exist
|
void |
requireRemoteBranchAbsent(String branch)
Requires that a remote branch with the given name does not yet exist
|
void |
requireRemoteBranchExists(String branch)
Requires that a remote branch with the given name exists
|
void |
requireTagAbsent(String name)
Requires that a tag with the given name does not yet exist
|
protected final org.eclipse.jgit.api.Git git
protected final GitFlowConfiguration gfConfig
protected final JGitFlowReporter reporter
protected final String commandName
public RequirementHelper(org.eclipse.jgit.api.Git git,
GitFlowConfiguration gfConfig,
String commandName)
public void requireGitFlowInitialized()
throws NotInitializedException,
JGitFlowGitAPIException
public void requireLocalBranchAbsent(String branch) throws LocalBranchExistsException, JGitFlowGitAPIException
branch - the name of the branch to testLocalBranchExistsExceptionJGitFlowGitAPIExceptionpublic void requireLocalBranchExists(String branch) throws LocalBranchMissingException, JGitFlowGitAPIException
branch - The name of the branch to testLocalBranchMissingExceptionJGitFlowGitAPIExceptionpublic void requireRemoteBranchAbsent(String branch) throws RemoteBranchExistsException, JGitFlowGitAPIException
branch - The name of the branch to testRemoteBranchExistsExceptionJGitFlowGitAPIExceptionpublic void requireRemoteBranchExists(String branch) throws RemoteBranchMissingException, JGitFlowGitAPIException
branch - The name of the branch to testRemoteBranchMissingExceptionJGitFlowGitAPIExceptionpublic void requireTagAbsent(String name) throws TagExistsException, JGitFlowGitAPIException
name - The name of the tag to testTagExistsExceptionJGitFlowGitAPIExceptionpublic void requireLocalBranchNotBehindRemote(String branch) throws BranchOutOfDateException, JGitFlowIOException
branch - The name of the branch to testBranchOutOfDateExceptionJGitFlowIOExceptionpublic void requireCleanWorkingTree(boolean allowUntracked)
throws DirtyWorkingTreeException,
JGitFlowIOException,
JGitFlowGitAPIException
public void requireNoExistingReleaseBranches()
throws ReleaseBranchExistsException,
JGitFlowGitAPIException
public void requireNoExistingHotfixBranches()
throws HotfixBranchExistsException,
JGitFlowGitAPIException
public void requireCommitOnBranch(org.eclipse.jgit.revwalk.RevCommit commit,
String branch)
throws LocalBranchExistsException,
JGitFlowGitAPIException,
JGitFlowIOException
commit - the commit to testbranch - the name of the branch to checkLocalBranchExistsExceptionJGitFlowGitAPIExceptionJGitFlowIOExceptionCopyright © 2023 DV Bern AG. All rights reserved.