GitPython
GitPython copied to clipboard
--object-format=sha256 support
When I git init --object-format=sha256 I receive
Traceback (most recent call last):
...
File "/usr/local/lib/python3.9/site-packages/git/repo/fun.py", line 163, in name_to_object
raise BadName(name)
gitdb.exc.BadName: Ref 'HEAD' did not resolve to an object
because the hash size is longer
Indeed, the custom rev-parsing doesn't know this format, but could certainly learn about it. I don't know where else there would be breakage though and don't expect supporting Sha256 properly would be easy.
In the mean time, the only workaround I see is to use git directly, maybe using the repo wrapper e.g. repo.git.rev_parse(…).