Open som-kanade opened 2 years ago
I think repository.head.target.raw
should work.
According to the docs previous commits are a list of binary strings
Commits can be created by calling the ``create_commit`` method of the
repository with the following parameters::
>>> author = Signature('Alice Author', 'alice@authors.tld')
>>> committer = Signature('Cecil Committer', 'cecil@committers.tld')
>>> tree = repo.TreeBuilder().write()
>>> repo.create_commit(
... 'refs/heads/master', # the name of the reference to update
... author, committer, 'one line commit message\n\ndetailed commit message',
... tree, # binary string representing the tree object ID
... [] # list of binary strings representing parents of the new commit
... )
'#\xe4<u\xfe\xd6\x17\xa0\xe6\xa2\x8b\xb6\xdc35$\xcf-\x8b~'
pygit2 == 1.7.0
I have been trying to commit changes to repo but unable to do so
snippet oid = repository.create_commit(, author, commiter, message, tree, [repository.head.get_object().hex])
author and commiter are already defined
looks like get_object. was deprecated in newer version . are there any work arounds in latest version for commiting changes
error >>
KeyError: 'the requested type does not match the type in the ODB'
let know if any more details are needed