I\'m developing a git post-receive hook in Python. Data is supplied on stdin with lines similar to
stdin
ef4d4037f8568e386629457d4d960915a85da2ae 61a4
If You want to check if reference is valid with pygit2 You can do like that function (code copied from documentation):
from pygit2 import reference_is_valid_name reference_is_valid_name("refs/heads/master")