def METHOD_NAME(branch_name):
    exit_code = subprocess.call(
        ['git', 'rev-parse', '--verify', '--quiet', branch_name])
    if exit_code == 0:
        return True
    elif exit_code == 1:
        return False
    else:
        raise ValueError('Error when checking for branch existence')