code: protected boolean gitCheckBranchExists(final String branchName)
              throws MojoFailureException, CommandLineException {
          CommandResult commandResult = executeGitCommandExitCode("show-ref",
                  "--verify", "--quiet", "refs/heads/" + branchName);
          return commandResult.getExitCode() == SUCCESS_EXIT_CODE;
      }
docs: Checks if local branch with given name exists.
  
  @param branchName
  Name of the branch to check.
  @return <code>true</code> if local branch exists, <code>false</code>
  otherwise.
  @throws MojoFailureException
  @throws CommandLineException