libgit2 / libgit2sharp

Git + .NET = ❤
http://libgit2.github.com
MIT License
3.11k stars 876 forks source link

git 2.40.0 index.skipHash incompatible with libgit2sharp (please update libgit2 from 1.7.1 to 1.8.0) #2090

Open DefaultRyan opened 2 months ago

DefaultRyan commented 2 months ago

Git added this feature in 2.40.0, and I'm increasingly encountering repos with this feature enabled that libgit2sharp is unable to process. Retrieving status throws an exception from the native libgit2 implementation that the checksums don't match.

The good news is that this issue was tracked by https://github.com/libgit2/libgit2/issues/6531 and fixed in their 1.8.0 release. I've verified that the failing repositories in libgit2sharp 0.29.0 (using libgit2 1.7.1) don't exhibit this issue under libgit2 1.8.0.

Reproduction steps

Open a repository that had the git config index.skipHash set to true. Call Repository.RetrieveStatus().

Expected behavior

The call successfully returns the status.

Actual behavior

An exception is thrown "invalid data in index - calculated checksum does not match expected"

Version of LibGit2Sharp (release number or SHA1)

0.29.0

Operating system(s) tested; .NET runtime tested

Win 11, .NET 8.0