summaryrefslogtreecommitdiffstats
path: root/fit.py
diff options
context:
space:
mode:
Diffstat (limited to 'fit.py')
-rw-r--r--fit.py8
1 files 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