libgit2 / libgit2/libgit2sharp
Failing to read huge pack files
还没有人认领这个 Issue。
- 主要语言
- C#
- 星标
- 3.5k
- 派生
- 925
- PR 合并指标
- 30 天内没有已合并 PR
描述
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
贡献指南
从这里开始
- 先读完整个 Issue,再读项目的贡献指南。
- 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
- Fork 仓库,在一个分支上完成修改。
- 提交 Pull Request,并在描述里引用这个 Issue 编号。
调研方向
首先,使用包含 5.56 GB pack 文件的 repository 重现该失败,然后检查 LibGit2Sharp/Core/Ensure.cs:154 的异常路径。将 commit 迭代和 Diff.Compare 的行为与 4.5 GB 的正常工作情况进行比较;当两个操作都能在不出现无效 pack 文件异常的情况下完成时,即表示完成。
由索引模型根据 Issue 内容生成。
评估
- 技术栈
- csharp, git
- 领域
- devtools
- Issue 类型
- 缺陷
- 难度
- 4/5
- 预计耗时
- 3-5 天
- 活跃度
- 停滞
- 描述清晰度
- 基本清楚
- 新手友好度
- 35/100