GitPython does not contain a 'is_valid_hash' method. #1266
-
|
Am I missing something or is that currently missing? The git command would be I used the following before using GitPython: Would a method like that fit into repo directly like I know |
Beta Was this translation helpful? Give feedback.
Replies: 3 comments
-
|
PS: If this is something that would be ok to include, I'd create the PR, I'm currently doing it with this: |
Beta Was this translation helpful? Give feedback.
-
|
PPS: We could also add default values to the |
Beta Was this translation helpful? Give feedback.
-
|
The fastest way to do this is this one: Line 65 in 6752fad As it will call A PR is welcome in case you would like to add a method to test for an objects existence on a |
Beta Was this translation helpful? Give feedback.
The fastest way to do this is this one:
GitPython/git/objects/base.py
Line 65 in 6752fad
As it will call
git cat-fileunder 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.