libgit2 / libgit2/libgit2sharp

Cannot push:failed to write chunk header

未關閉
#1,528 4 則留言 4 個 reaction 已指派 0 人 在 GitHub 檢視

還沒有人認領這個 Issue。

主要語言
C#
星號
3.5k
分支
925
PR 合併指標
30 天內沒有已合併 PR

描述

I used 0.25.0-preview-0073 with Core

`using (var repo = new Repository(RepositoryPath))
{
// Stage the file
Commands.Stage(repo, "*");

// Create the committer's signature and commit
Signature author = new Signature("translator", "example.com", DateTime.Now);
Signature committer = author;

// Commit to the repository
Commit commit = repo.Commit($"Resx files updated {DateTime.Now}", author, committer);

Remote remote = repo.Network.Remotes["origin"];
var options = new PushOptions
{
    CredentialsProvider = (_url, _user, _cred) =>
       new UsernamePasswordCredentials
       {
           Username = _settings.GitUserName,
           Password = _settings.GitPassword
       }
 };
 repo.Network.Push(remote, @"refs/heads/master", options);

} `

And I get error when I try to push a large file ( > 1GB)

LibGit2Sharp.LibGit2SharpException: failed to write chunk header: The connection with the server was terminated abnormally

at LibGit2Sharp.Core.Ensure.HandleError(Int32 result) in C:\projects\libgit2sharp\LibGit2Sharp\Core\Ensure.cs:line 136
at LibGit2Sharp.Core.Proxy.git_remote_push(RemoteHandle remote, IEnumerable1 refSpecs, GitPushOptions opts) in C:\projects\libgit2sharp\LibGit2Sharp\Core\Proxy.cs:line 2225 at LibGit2Sharp.Network.Push(Remote remote, IEnumerable1 pushRefSpecs, PushOptions pushOptions) in C:\projects\libgit2sharp\LibGit2Sharp\Network.cs:line 372
at VA.Services.BitbucketService.d__4.MoveNext() in D:\Sources\VA\migrationTool\VA.Services\BitbucketService.cs:line 88

With small file works fine

貢獻指南

開啟貢獻指南

從這裡開始

  1. 先讀完整個 Issue,再讀專案的貢獻指南。
  2. 在 Issue 下留言說明你要接手 —— 這能避免兩個人做同樣的事。
  3. Fork 儲存庫,在一個分支上完成修改。
  4. 送出 Pull Request,並在描述裡引用這個 Issue 編號。

研究方向

使用所示的 LibGit2Sharp 程式碼,重現推送大於 1 GB 的檔案,並將其與小檔案的情況進行比較。從 LibGit2Sharp/Network.cs:372 和 Core/Proxy.cs:2225 開始,然後透過 Core/Ensure.cs:136 追蹤錯誤。大型推送不再異常終止,或已記錄該限制及所需條件,即表示完成。

由索引模型根據 Issue 內容生成。

評估

技術堆疊
csharp, git
領域
tooling
Issue 類型
缺陷
難度
4/5
預估耗時
3-5 天
活躍度
停滯
描述清晰度
基本清楚
新手友好度
35/100

把新 issue 寄到你的電子郵件信箱

精選適合新手參與的 GitHub issue 摘要。