-
-
Notifications
You must be signed in to change notification settings - Fork 964
Closed
Description
Am I missing something or is that currently missing?
The git command would be git cat-file commit {git_hash}.
I used the following before using GitPython:
def git_hash_is_valid(git_hash):
return subprocess_return_call(f"git cat-file commit {git_hash}") == 0
def subprocess_return_call(call_string):
call_parameters = call_string.split(" ")
return subprocess.call(
call_parameters,
stderr=subprocess.STDOUT,
stdout=open(os.devnull, 'w')
)
Would a method like that fit into repo directly like repo.is_ancestor()?
I know self.repo.commit( works, but that does not differentiate between refs and commit hashes.
Metadata
Metadata
Assignees
Labels
No labels