GitPython icon indicating copy to clipboard operation
GitPython copied to clipboard

--object-format=sha256 support

Open cblp opened this issue 3 years ago • 1 comments

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

cblp avatar Aug 06 '22 02:08 cblp

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(…).

Byron avatar Aug 07 '22 00:08 Byron