libgit2 / libgit2/libgit2sharp

sha256 not yet supported

Open
#2,153 0 comments 1 reaction 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
C#
Stars
3.5k
Forks
925
PR merge metrics
No merged PRs in 30d

Description

When running new Repository(dir) on a sha256 enabled repo, it fails with a LibGit2SharpException stating unknown object format 'sha256'.

see: https://git-scm.com/docs/hash-function-transition

   at LibGit2Sharp.Core.Ensure.HandleError(Int32 result) in /_/LibGit2Sharp/Core/Ensure.cs:line 154
   at LibGit2Sharp.Repository..ctor(String path, RepositoryOptions options, RepositoryRequiredParameter requiredParameter) in /_/LibGit2Sharp/Repository.cs:line 35

At first glance it looks like libgit2 doesn't support this yet.

Version used: LibGit2Sharp 0.31.0, using LibGit2Sharp.NativeBinaries 2.0.323

To be fair: we only have one repo using sha256 for compatibility testing - and while git cli works great, 3rd-party tooling is still abysmal.

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start at the Repository constructor in Repository.cs:35 and inspect how Ensure.cs:154 surfaces the native error. Check the linked hash-function transition documentation and libgit2 support status first; done means opening a sha256-enabled repository no longer fails, with compatibility coverage established for this case.

Written by the indexing model from the issue text.

Assessment

Tech stack
csharp, git
Domain
tooling
Issue type
Feature
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.