/** * Requires that a local branch with the given name does not yet exist * * @param branch the name of the branch to test * @throws com.atlassian.jgitflow.core.exception.LocalBranchExistsException * @throws com.atlassian.jgitflow.core.exception.JGitFlowGitAPIException */ public void requireLocalBranchAbsent(String branch) throws LocalBranchExistsException, JGitFlowGitAPIException { if (GitHelper.localBranchExists(git, branch)) { reporter.errorText(commandName, "requireLocalBranchAbsent() failed: '" + branch + "' already exists"); reporter.flush(); throw new LocalBranchExistsException("local branch '" + branch + "' already exists"); } }
/** * Requires that a local branch with the given name does not yet exist * * @param branch the name of the branch to test * @throws com.atlassian.jgitflow.core.exception.LocalBranchExistsException * @throws com.atlassian.jgitflow.core.exception.JGitFlowGitAPIException */ public void requireLocalBranchAbsent(String branch) throws LocalBranchExistsException, JGitFlowGitAPIException { if (GitHelper.localBranchExists(git, branch)) { reporter.errorText(commandName, "requireLocalBranchAbsent() failed: '" + branch + "' already exists"); reporter.flush(); throw new LocalBranchExistsException("local branch '" + branch + "' already exists"); } }
/** * Requires that a local branch with the given name does not yet exist * @param branch the name of the branch to test * @throws LocalBranchExistsException * @throws JGitFlowGitAPIException */ protected void requireLocalBranchAbsent(String branch) throws LocalBranchExistsException, JGitFlowGitAPIException { if (GitHelper.localBranchExists(git, branch)) { reporter.errorText(getCommandName(), "requireLocalBranchAbsent() failed: '" + branch + "' already exists"); reporter.flush(); throw new LocalBranchExistsException("local branch '" + branch + "' already exists"); } }
/** * Requires that a local branch contains the given commit * * @param commit the commit to test * @param branch the name of the branch to check */ public void requireCommitOnBranch(RevCommit commit, String branch) throws LocalBranchExistsException, JGitFlowGitAPIException, JGitFlowIOException { if (!GitHelper.isMergedInto(git, commit, branch)) { reporter.errorText(commandName, "requireCommitOnBranch() failed: '" + commit.getName() + "' is not on " + branch); reporter.flush(); throw new LocalBranchExistsException("commit '" + commit.getName() + "' does not exist on " + branch); } } }
/** * Requires that a local branch contains the given commit * * @param commit the commit to test * @param branch the name of the branch to check */ public void requireCommitOnBranch(RevCommit commit, String branch) throws LocalBranchExistsException, JGitFlowGitAPIException, JGitFlowIOException { if (!GitHelper.isMergedInto(git, commit, branch)) { reporter.errorText(commandName, "requireCommitOnBranch() failed: '" + commit.getName() + "' is not on " + branch); reporter.flush(); throw new LocalBranchExistsException("commit '" + commit.getName() + "' does not exist on " + branch); } } }
/** * Requires that a local branch contains the given commit * @param commit the commit to test * @param branch the name of the branch to check * @throws LocalBranchMissingException * @throws JGitFlowGitAPIException */ protected void requireCommitOnBranch(RevCommit commit, String branch) throws LocalBranchExistsException, JGitFlowGitAPIException, JGitFlowIOException { if (!GitHelper.isMergedInto(git,commit,branch)) { reporter.errorText(getCommandName(), "requireCommitOnBranch() failed: '" + commit.getName() + "' is not on " + branch); reporter.flush(); throw new LocalBranchExistsException("commit '" + commit.getName() + "' does not exist on " + branch); } }