summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorNico von Geyso <Nico.Geyso@FU-Berlin.de>2014-02-18 19:27:31 +0100
committerNico von Geyso <Nico.Geyso@FU-Berlin.de>2014-03-25 15:28:38 +0100
commite13d23f0cdb7f9462850b805010f611ad20b6cce (patch)
treefedde9eeda7debef94eef33872e62fa470b4982d
parentde94e1cf9f1e7bce42670b58b78c3c5f99e08ee4 (diff)
downloadklausuren-e13d23f0cdb7f9462850b805010f611ad20b6cce.tar.gz
klausuren-e13d23f0cdb7f9462850b805010f611ad20b6cce.tar.bz2
klausuren-e13d23f0cdb7f9462850b805010f611ad20b6cce.zip
Fixed: adapt api changs for pygit2
-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