This is an automated email from the ASF dual-hosted git repository.
kou pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/arrow.git
The following commit(s) were added to refs/heads/main by this push:
new 11decbc107 GH-41735: [CI][Archery] Update archery to be compatible
with pygit2 1.15 API change (#41739)
11decbc107 is described below
commit 11decbc10776bbe0361fe7b8bfebcf3e47ae9c6c
Author: Raúl Cumplido <[email protected]>
AuthorDate: Mon May 20 17:17:38 2024 -0400
GH-41735: [CI][Archery] Update archery to be compatible with pygit2 1.15
API change (#41739)
### Rationale for this change
pygit2 updated how they expose some of the `GIT_OBJ` variables to use
`GIT_OBJECT` prefix here:
https://github.com/libgit2/pygit2/commit/8b3861b9092d1e3517b11f6ab06434ea866dd051
### What changes are included in this PR?
Update code to make it compatible with both possible APIs.
### Are these changes tested?
Via archery
### Are there any user-facing changes?
No
* GitHub Issue: #41735
Authored-by: Raúl Cumplido <[email protected]>
Signed-off-by: Sutou Kouhei <[email protected]>
---
dev/archery/archery/crossbow/core.py | 8 +++++++-
1 file changed, 7 insertions(+), 1 deletion(-)
diff --git a/dev/archery/archery/crossbow/core.py
b/dev/archery/archery/crossbow/core.py
index c85f1f754b..0b5d242bba 100644
--- a/dev/archery/archery/crossbow/core.py
+++ b/dev/archery/archery/crossbow/core.py
@@ -427,8 +427,14 @@ class Repo:
return branch
def create_tag(self, tag_name, commit_id, message=''):
+ git_object_commit = (
+ pygit2.GIT_OBJECT_COMMIT
+ if getattr(pygit2, 'GIT_OBJECT_COMMIT')
+ else pygit2.GIT_OBJ_COMMIT
+ )
tag_id = self.repo.create_tag(tag_name, commit_id,
- pygit2.GIT_OBJ_COMMIT, self.signature,
+ git_object_commit,
+ self.signature,
message)
# append to the pushable references