Skip to content

Commit c53f821

Browse files
raulcdlriggs
authored andcommitted
apacheGH-41735: [CI][Archery] Update archery to be compatible with pygit2 1.15 API change (apache#41739)
### Rationale for this change pygit2 updated how they expose some of the `GIT_OBJ` variables to use `GIT_OBJECT` prefix here: libgit2/pygit2@8b3861b ### 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: apache#41735 Authored-by: Raúl Cumplido <raulcumplido@gmail.com> Signed-off-by: Sutou Kouhei <kou@clear-code.com>
1 parent 343f70f commit c53f821

1 file changed

Lines changed: 7 additions & 1 deletion

File tree

  • dev/archery/archery/crossbow

dev/archery/archery/crossbow/core.py

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -427,8 +427,14 @@ def create_branch(self, branch_name, files, parents=None, message='',
427427
return branch
428428

429429
def create_tag(self, tag_name, commit_id, message=''):
430+
git_object_commit = (
431+
pygit2.GIT_OBJECT_COMMIT
432+
if getattr(pygit2, 'GIT_OBJECT_COMMIT')
433+
else pygit2.GIT_OBJ_COMMIT
434+
)
430435
tag_id = self.repo.create_tag(tag_name, commit_id,
431-
pygit2.GIT_OBJ_COMMIT, self.signature,
436+
git_object_commit,
437+
self.signature,
432438
message)
433439

434440
# append to the pushable references

0 commit comments

Comments
 (0)