libgit2 / libgit2/libgit2sharp

Cannot push:failed to write chunk header

Đang mở
#1,528 4 bình luận 4 reaction 0 người được giao Xem trên GitHub

Chưa có ai nhận issue này.

Ngôn ngữ chính
C#
Star
3.5k
Fork
925
Chỉ số merge pull request
Không có pull request nào được merge trong 30 ngày

Mô tả

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

Hướng dẫn đóng góp

Mở hướng dẫn đóng góp

Bắt đầu từ đâu

  1. Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
  2. Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
  3. Fork repository và làm thay đổi trên một nhánh.
  4. Mở pull request có tham chiếu số hiệu của issue.

Hướng nghiên cứu

Tái hiện thao tác push với một tệp lớn hơn 1 GB và so sánh với trường hợp tệp nhỏ bằng cách sử dụng mã LibGit2Sharp được cung cấp. Bắt đầu tại LibGit2Sharp/Network.cs:372 và Core/Proxy.cs:2225, sau đó lần theo lỗi qua Core/Ensure.cs:136. Công việc được xem là hoàn tất khi thao tác push lớn không còn kết thúc bất thường hoặc khi giới hạn và các điều kiện bắt buộc được ghi lại.

Do mô hình lập chỉ mục viết ra từ nội dung của issue.

Đánh giá

Công nghệ
csharp, git
Lĩnh vực
tooling
Loại issue
Lỗi
Độ khó
4/5
Thời gian dự kiến
3-5 ngày
Mức độ hoạt động
Đình trệ
Độ rõ ràng
Khá rõ ràng
Mức phù hợp với người mới
35/100

Nhận issue mới trong hộp thư của bạn

Bản tóm tắt ngắn những issue GitHub phù hợp với người mới.