def _check_single_line(value):
    """Makes sure the value is a one-line output from the command line.

    Args:
        value: String; command line output.

    Raises:
        GitRvException: If the value is not a single line ending with a newline
            character.
    """
    if not value.endswith('\n') or value.count('\n') != 1:
        raise GitRvException('Subject %r is incorrectly formatted.' % (value,))


# TODO(dhermes): Consider making single_line default to False instead.
dataset/ETHPy150Open googlearchive/git-rv/utils.py/_check_single_line/original