def git_diff()

in foundation_security_advisories/common.py [0:0]


def git_diff(staged):
    """
    Return the modified files in the repo.
    :param staged: boolean return only those changes staged in git
    :return: list modified file names.
    """
    command = [GIT, "diff", "--name-only"]
    if staged:
        command.append("--cached")

    git_out = check_output(command, universal_newlines=True).split()
    return [
        fn
        for fn in git_out
        if MFSA_FILENAME_RE.search(fn) or HOF_FILENAME_RE.search(fn)
    ]