Skip to content
Discussion options

You must be logged in to vote
Answered by Byron Jun 5, 2021

The fastest way to do this is this one:

oinfo=repo.odb.info(sha1)

As it will call git cat-file under the hood it might be that other forms of rev names are also supported, like branch names and the likes. It's certainly something to test out if that's a problem in this case.

A PR is welcome in case you would like to add a method to test for an objects existence on a Repo.

Replies: 3 comments

Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
0 replies
Comment options

Byron
Jun 5, 2021
Maintainer

You must be logged in to vote
0 replies
Answer selected byByron
Sign up for freeto join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants
@bytefluxio@Byron
Converted from issue

This discussion was converted from issue #1265 on June 05, 2021 02:15.