Fix generating diffs between trees using recent pygit2 versions