/** * Requires that a remote branch with the given name does not yet exist * * @param branch The name of the branch to test * @throws com.atlassian.jgitflow.core.exception.RemoteBranchExistsException * @throws com.atlassian.jgitflow.core.exception.JGitFlowGitAPIException */ public void requireRemoteBranchAbsent(String branch) throws RemoteBranchExistsException, JGitFlowGitAPIException { if (GitHelper.remoteBranchExists(git, branch)) { reporter.errorText(commandName, "requireRemoteBranchAbsent() failed: '" + branch + "' already exists"); reporter.flush(); throw new RemoteBranchExistsException("remote branch '" + branch + "' already exists"); } }
/** * Requires that a remote branch with the given name does not yet exist * * @param branch The name of the branch to test * @throws com.atlassian.jgitflow.core.exception.RemoteBranchExistsException * @throws com.atlassian.jgitflow.core.exception.JGitFlowGitAPIException */ public void requireRemoteBranchAbsent(String branch) throws RemoteBranchExistsException, JGitFlowGitAPIException { if (GitHelper.remoteBranchExists(git, branch)) { reporter.errorText(commandName, "requireRemoteBranchAbsent() failed: '" + branch + "' already exists"); reporter.flush(); throw new RemoteBranchExistsException("remote branch '" + branch + "' already exists"); } }
/** * Requires that a remote branch with the given name does not yet exist * @param branch The name of the branch to test * @throws RemoteBranchExistsException * @throws JGitFlowGitAPIException */ protected void requireRemoteBranchAbsent(String branch) throws RemoteBranchExistsException, JGitFlowGitAPIException { if (GitHelper.remoteBranchExists(git, branch, reporter)) { reporter.errorText(getCommandName(), "requireRemoteBranchAbsent() failed: '" + branch + "' already exists"); reporter.flush(); throw new RemoteBranchExistsException("remote branch '" + branch + "' already exists"); } }