From b631c49d0817651d133ddd5b9d52847942cf2db9 Mon Sep 17 00:00:00 2001 From: Pierre-Yves Chibon Date: Thu, 11 Jun 2020 21:39:23 +0200 Subject: [PATCH] git/hook: apparently the rev can be either a string or the pygit2.Oid object Signed-off-by: Pierre-Yves Chibon --- roles/git/hooks/files/post-receive-fedora-messaging | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/roles/git/hooks/files/post-receive-fedora-messaging b/roles/git/hooks/files/post-receive-fedora-messaging index 0147f7cebb..7332e527fb 100644 --- a/roles/git/hooks/files/post-receive-fedora-messaging +++ b/roles/git/hooks/files/post-receive-fedora-messaging @@ -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.