git/hook: apparently the rev can be either a string or the pygit2.Oid object

Signed-off-by: Pierre-Yves Chibon <pingou@pingoured.fr>
This commit is contained in:
Pierre-Yves Chibon 2020-06-11 21:39:23 +02:00
parent 4614a6ebf2
commit b631c49d08

View file

@ -120,7 +120,10 @@ for line in lines:
revs = [head.id]
def _build_commit(rev):
commit = repo.revparse_single(rev.hex)
if instance(rev, str):
commit = repo.revparse_single(rev)
else:
commit = repo.revparse_single(rev.hex)
# Tags are a little funny, and vary between versions of pygit2, so we'll
# just ignore them as far as fedmsg is concerned.