def collect_response(response_lines):
    """
    Collect a Git response into a dictionary by response type.

    Arguments
    ---------
    response_lines: iterable
        a list of lines of text returned by Git

    Returns
    -------
    dict
        a dictionary with keys corresponding to `git status` output types
        (e.g., '#', '1', or '?') and lists of lines as values
    """
    response_dict = {}
    for entry in filter(None, response_lines):
        prefix = entry[0]
        if prefix in response_dict:
            response_dict[prefix] += [entry]
        else:
            response_dict[prefix] = [entry]
    return response_dict