Convert hashfile to a function on pygit2