Close the submodule repository when fetch fails during update

Đang mở Phù hợp với người mới
#327 0 bình luận 0 reaction 0 người được giao Xem trên GitHub

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

Đánh giá

Độ khó
2/5
Thời gian dự kiến
1-3 giờ
Mức phù hợp với người mới
77/100
Loại issue
Lỗi
Độ rõ ràng
Đặc tả rõ ràng
Mức độ hoạt động
Sôi nổi
Công nghệ
git, java
Lĩnh vực
backend, devtools

Hướng nghiên cứu

Bắt đầu với SubmoduleUpdateCommand.java tại các dòng được trích dẫn và theo dõi cách helper cập nhật xử lý repository xung quanh thao tác fetch có điều kiện. Kiểm tra các bài kiểm thử cập nhật submodule hiện có để tìm stub fetch cục bộ và phần xác minh repository đã được đóng. Công việc hoàn tất khi lỗi fetch vẫn được truyền lên và repository được lấy cho lần cập nhật đó được đóng.

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

Mô tả

Version reviewed: org.eclipse.jgit 7.8.1.202611041320-r

In a unit check on macOS 26.6.2 with OpenJDK 21.0.12.1, the submodule walk supplied an existing recording Repository and the fetch operation reported a TransportException. The public update call propagated that exception. The repository received no close call. The test used a local fetch stub.

SubmoduleUpdateCommand opens an existing or restored submodule repository and conditionally fetches before returning it to its caller. If fetch fails, the caller's try-with-resources statement never receives that repository, so its matching close is skipped.

Retain responsibility for the repository until the helper returns it successfully. A failed fetch should release the reference acquired for that update.

https://github.com/eclipse-jgit/jgit/blob/2784b2cb0164726a2923848dc9c8087925d51b97/org.eclipse.jgit/src/org/eclipse/jgit/api/SubmoduleUpdateCommand.java#L161-L205

The result above was checked locally against the cited release. This report was drafted with AI assistance.

Ngôn ngữ chính
Java
Star
427
Fork
116
Chỉ số merge pull request
Không có pull request nào được merge trong 30 ngày

Chuẩn bị môi trường

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.

Issue khác của eclipse-jgit/jgit

Tất cả issue của eclipse-jgit/jgit

Issue tương tự

Thêm issue về Java

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.