Open Hritik14 opened 1 year ago
If the commit has no parents, diff its tree against an empty tree.
if not commit.parents:
diff = commit.tree.diff_to_tree(swap=True)
@jorio It will be helpful to have this in the documentation as well. Could you please add ?
docs at https://www.pygit2.org/recipes/git-show.html suggest to diff against parent to get diff show contents. For initial commits, there are not parents, thus raising
IndexError