def _diff_for(gitrepo, rev_range=None):
    """
    Get a list of :py:class:`git.diff.Diff` objects for the repository.

    :param git.repo.base.Repo gitrepo: Git repository
    :param RevRangePair rev_range: optional revision to use instead of the
        Git index
    """
    if rev_range:
        return rev_range.a.diff(rev_range.b)
    else:
        # Assume we want a diff between what is staged and HEAD
        try:
            return gitrepo.head.commit.diff()
        except ValueError:
            return None