Skip to content
Snippets Groups Projects
Commit 7fd481e5 authored by Jonas Haag's avatar Jonas Haag
Browse files

Fix commit diffing: Handle commits without parents (first commit)

parent 237c4005
No related branches found
No related tags found
No related merge requests found
......@@ -66,10 +66,13 @@ class RepoWrapper(dulwich.repo.Repo):
return ((entry.path, entry.in_path(root)) for entry in tree.iteritems())
def commit_diff(self, commit):
parent = self[commit.parents[0]]
if commit.parents:
parent_tree = self[commit.parents[0]].tree
else:
parent_tree = None
stringio = StringIO()
dulwich.patch.write_tree_diff(stringio, self.object_store,
parent.tree, commit.tree)
parent_tree, commit.tree)
return stringio.getvalue()
def Repo(name, path, _cache={}):
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment