Skip to content

Commit

Permalink
apacheGH-41735: [CI][Archery] Update archery to be compatible with py…
Browse files Browse the repository at this point in the history
…git2 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 <[email protected]>
Signed-off-by: Sutou Kouhei <[email protected]>
  • Loading branch information
raulcd authored and vibhatha committed May 25, 2024
1 parent 5273978 commit 8dd38cd
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion dev/archery/archery/crossbow/core.py
Original file line number Diff line number Diff line change
Expand Up @@ -427,8 +427,14 @@ def create_branch(self, branch_name, files, parents=None, message='',
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
Expand Down

0 comments on commit 8dd38cd

Please sign in to comment.