libgit2 / libgit2/libgit2sharp
Push fails with "No error message has been provided by the native library" when trying to push large files
还没有人认领这个 Issue。
- 主要语言
- C#
- 星标
- 3.5k
- 派生
- 925
- PR 合并指标
- 30 天内没有已合并 PR
描述
I am not able to push large files to origin with pre-release 0.27.0-preview-0182. The same code worked with latest stable release
Ending up with exception and message: "No error message has been provided by the native library"
Tried to push a new json file which is 18MB large.
I did not check what file size is the breaking point, but if needed can try to investigate that too.
Adding reproduction steps with snippets of my code, hope this is enough, otherwise please ask for more.
Reproduction steps
- Clone repository and create branch
Repository.Clone(githubRepoUrl, $"./{folderName}",
new CloneOptions { CredentialsProvider = _gitHubClientWrapper.CredentialsProvider() });
using (var repo = new Repository($"./{folderName}"))
{
repo.CreateBranch(newBranchName);
}
- Create large file. I just generated a large list of objects serialized into json. Got around 18mb of json file.
- Commit and push the branch to origin
using (var repo = new Repository($"./{folderName}"))
{
Branch branch = repo.Branches[newBranchName];
Commands.Checkout(repo, branch);
Commands.Stage(repo, "*");
Signature committer = new Signature("Github bot", "@bot", DateTime.Now);
try
{
repo.Commit("Comit message", committer, committer);
Remote remote = repo.Network.Remotes["origin"];
repo.Branches.Update(branch, b => b.Remote = remote.Name, b => b.UpstreamBranch = branch.CanonicalName);
repo.Network.Push(branch, new PushOptions
{
CredentialsProvider = _gitHubClientWrapper.CredentialsProvider(),
});
}
catch (EmptyCommitException)
{
_logger.LogInformation("There's nothing to commit.");
return;
}
}
Expected behavior
Push is successful.
Actual behavior
Push fails with exception and message "No error message has been provided by the native library"
Version of LibGit2Sharp (release number or SHA1)
0.27.0-preview-0182
Operating system(s) tested; .NET runtime tested
Windows11, .NET 7
贡献指南
从这里开始
- 先读完整个 Issue,再读项目的贡献指南。
- 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
- Fork 仓库,在一个分支上完成修改。
- 提交 Pull Request,并在描述里引用这个 Issue 编号。
调研方向
通过克隆仓库、创建一个约 18 MB 的 JSON 文件、提交该文件,并在 0.27.0-preview-0182 上使用显示的 PushOptions 调用 repo.Network.Push 来复现该故障;将相同步骤与最新稳定版本进行比较。跟踪 Repository 和 repo.Network.Push 的入口点,并确定回归是在 push 处理过程中,还是在原生错误报告中;当大文件 push 成功,或报告有用且可采取行动的错误时,即表示完成。
由索引模型根据 Issue 内容生成。
评估
- 技术栈
- csharp, git
- 领域
- devtools
- Issue 类型
- 缺陷
- 难度
- 4/5
- 预计耗时
- 3-5 天
- 活跃度
- 停滞
- 描述清晰度
- 基本清楚
- 新手友好度
- 35/100