libgit2 / libgit2/libgit2sharp
Failing to read huge pack files
Dieses Issue hat noch niemand übernommen.
- Vorherrschende Sprache
- C#
- Sterne
- 3.5k
- Forks
- 925
- PR-Merge-Kennzahlen
- Keine gemergten PRs in 30 T.
Beschreibung
I'm using lib2gitsharp with big enterprise repositories which may have pack files with a size of 4 to 5 GB. When the size of the initially cloned pack file exceeds a certain value, reading operations will fail. I started with a 4.5 GB pack file repo, which I updated incrementally for some months. This poses no problems. When I freshly clone the same repo now, the initial pack file has (due to ongoing development) grown to 5.5 GB, which lib2gitsharp cannot handle any more.
Reproduction steps
Connect to a repository with pack files of size between 4.5 GB (working) and 5.56 GB (failing).
Iterate the commits of a branch or call a Diff.Compare on two Trees.
Expected behavior
Iterating the commit collection or comparing two trees works without exception.
Actual behavior
A LibGit2SharpException exception is thrown:
LibGit2Sharp.LibGit2SharpException
HResult=0x80131500
Message=invalid pack file - delta offset is zero
Source=LibGit2Sharp
StackTrace:
at LibGit2Sharp.Core.Ensure.HandleError(Int32 result) in C:\projects\libgit2sharp\LibGit2Sharp\Core\Ensure.cs:line 154
Version of LibGit2Sharp (release number or SHA1)
0.26.2
Operating system(s) tested; .NET runtime tested
Win 10, .NET Framework 4.8
Beitragsleitfaden
Erste Schritte
- Lies das ganze Issue und danach den Beitragsleitfaden des Projekts.
- Schreib ins Issue, dass du es übernimmst — das erspart doppelte Arbeit.
- Forke das Repository und arbeite in einem Branch.
- Öffne einen Pull Request, der die Issue-Nummer nennt.
Rechercherichtung
Beginne damit, den Fehler mit einem Repository zu reproduzieren, das eine 5.56 GB große Pack-Datei enthält, und untersuche anschließend den Ausnahmeweg in LibGit2Sharp/Core/Ensure.cs:154. Vergleiche die Commit-Iteration und das Verhalten von Diff.Compare mit dem funktionierenden Fall mit 4.5 GB; als erledigt gilt die Aufgabe, wenn beide Vorgänge ohne die Ausnahme einer ungültigen Pack-Datei abgeschlossen werden.
Vom Indexierungsmodell aus dem Issue-Text verfasst.
Bewertung
- Tech-Stack
- csharp, git
- Bereich
- devtools
- Issue-Typ
- Bug
- Schwierigkeit
- 4/5
- Geschätzter Aufwand
- 3-5 Tage
- Aktivitätsstatus
- Veraltet
- Klarheit
- Größtenteils klar
- Anfängerfreundlichkeit
- 35/100