def split_sections(diff):
    """
    takes a git diff and breaks it up into sections
    :param diff: a diff piped from git
    :return: a list of sections
    """
    sections = []
    section = ''

    for line in diff.splitlines():
        line = line.strip()
        if line.startswith('@@'):
            if section:
                sections.append(section)
            section = line
            continue

        if line and section.startswith('@@'):
            section += '\n' + line

    sections.append(section)
    return sections