From e13d23f0cdb7f9462850b805010f611ad20b6cce Mon Sep 17 00:00:00 2001 From: Nico von Geyso Date: Tue, 18 Feb 2014 19:27:31 +0100 Subject: Fixed: adapt api changs for pygit2 --- fit.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/fit.py b/fit.py index 4725880..6fbc13f 100644 --- a/fit.py +++ b/fit.py @@ -31,9 +31,9 @@ class Fit: def add_file(self, data, path): """ Inserts the given file in the git tree and commits the changes """ try: - commit = self._get_last_commit() - parents = [commit.oid] - root = commit.tree.oid + commit = self.repo.head.get_object() + parents = commit.parents + root = commit.tree.id except: parents = [] @@ -50,7 +50,7 @@ class Fit: committer, 'added %s' % path, tree, - parents + [p.id for p in parents] ) # save the actual head sha for dump git http protocol -- cgit v1.2.3-1-g7c22