libgit2 / libgit2/libgit2sharp
Push fails with "No error message has been provided by the native library" when trying to push large files
まだ誰も着手していません。
- 主要言語
- 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 にコメントします — 二人が同じ作業をするのを防げます。
- リポジトリをフォークし、ブランチを切って変更します。
- issue 番号を参照したプルリクエストを送ります。
調査の方向性
リポジトリを clone し、約 18 MB の JSON ファイルを作成して commit し、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