Skip to content

Comments

Expand packfile checks#1836

Merged
pjbgf merged 3 commits intoreleases/v5.xfrom
check-v5
Feb 9, 2026
Merged

Expand packfile checks#1836
pjbgf merged 3 commits intoreleases/v5.xfrom
check-v5

Conversation

@pjbgf
Copy link
Member

@pjbgf pjbgf commented Feb 9, 2026

Introduces additional checks across pack and idx files.

Copilot AI review requested due to automatic review settings February 9, 2026 09:33
@pjbgf pjbgf mentioned this pull request Feb 9, 2026
@pjbgf pjbgf requested a review from hiddeco February 9, 2026 09:35
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Adds integrity validation for Git pack/idx handling by verifying checksums and cross-file consistency (pack hash ↔ idx pack checksum), with new regression tests covering corrupted pack/idx scenarios.

Changes:

  • Validate pack trailer checksum during pack scanning and surface “malformed PACK” errors on corruption.
  • Validate idx checksum during idx decoding and verify idx pack checksum matches the target pack hash in filesystem storage.
  • Add new tests for checksum mismatches and pack/idx mismatch behavior.

Reviewed changes

Copilot reviewed 7 out of 7 changed files in this pull request and generated 4 comments.

Show a summary per file
File Description
storage/filesystem/object_test.go Adds test that an idx file belonging to a different pack triggers a malformed idx error.
storage/filesystem/object.go Adds packfile/idx cross-check (idx’s recorded pack checksum must match target pack hash).
plumbing/format/packfile/scanner.go Adds running hash computation and checksum verification for pack trailer.
plumbing/format/packfile/parser_test.go Adds tests for pack checksum mismatch and truncated pack behavior.
plumbing/format/packfile/parser.go Wraps EOF-related errors as malformed PACK errors.
plumbing/format/idxfile/decoder_test.go Adds test for idx checksum mismatch.
plumbing/format/idxfile/decoder.go Adds idx checksum verification during decode (via TeeReader hashing).

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@pjbgf pjbgf merged commit 48a1ae0 into releases/v5.x Feb 9, 2026
29 checks passed
@pjbgf pjbgf deleted the check-v5 branch February 9, 2026 12:45
arthurzam pushed a commit to gentoo-golang-dist/forgejo-runner that referenced this pull request Feb 19, 2026
This PR contains the following updates:

| Package | Change | [Age](https://docs.renovatebot.com/merge-confidence/) | [Confidence](https://docs.renovatebot.com/merge-confidence/) |
|---|---|---|---|
| [github.com/go-git/go-git/v5](https://github.com/go-git/go-git) | `v5.16.4` -> `v5.16.5` | ![age](https://developer.mend.io/api/mc/badges/age/go/github.com%2fgo-git%2fgo-git%2fv5/v5.16.5?slim=true) | ![confidence](https://developer.mend.io/api/mc/badges/confidence/go/github.com%2fgo-git%2fgo-git%2fv5/v5.16.4/v5.16.5?slim=true) |

---

### Release Notes

<details>
<summary>go-git/go-git (github.com/go-git/go-git/v5)</summary>

### [`v5.16.5`](https://github.com/go-git/go-git/releases/tag/v5.16.5)

[Compare Source](go-git/go-git@v5.16.4...v5.16.5)

#### What's Changed

- build: Update module golang.org/x/crypto to v0.45.0 \[SECURITY] (releases/v5.x) by [@&#8203;go-git-renovate](https://github.com/go-git-renovate)\[bot] in [#&#8203;1744](go-git/go-git#1744)
- build: Bump Go test versions to 1.23-1.25 (v5) by [@&#8203;pjbgf](https://github.com/pjbgf) in [#&#8203;1746](go-git/go-git#1746)
- \[v5] git: worktree, Don't delete local untracked files when resetting worktree by [@&#8203;Ch00k](https://github.com/Ch00k) in [#&#8203;1800](go-git/go-git#1800)
- Expand packfile checks by [@&#8203;pjbgf](https://github.com/pjbgf) in [#&#8203;1836](go-git/go-git#1836)

**Full Changelog**: <go-git/go-git@v5.16.4...v5.16.5>

</details>

---

### Configuration

📅 **Schedule**: Branch creation - Between 12:00 AM and 03:59 AM ( * 0-3 * * * ) (UTC), Automerge - Between 12:00 AM and 03:59 AM ( * 0-3 * * * ) (UTC).

🚦 **Automerge**: Disabled by config. Please merge this manually once you are satisfied.

♻ **Rebasing**: Whenever PR becomes conflicted, or you tick the rebase/retry checkbox.

🔕 **Ignore**: Close this PR and you won't be reminded about this update again.

---

 - [ ] <!-- rebase-check -->If you want to rebase/retry this PR, check this box

---

This PR has been generated by [Renovate Bot](https://github.com/renovatebot/renovate).
<!--renovate-debug:eyJjcmVhdGVkSW5WZXIiOiI0My41LjAiLCJ1cGRhdGVkSW5WZXIiOiI0My41LjAiLCJ0YXJnZXRCcmFuY2giOiJtYWluIiwibGFiZWxzIjpbIktpbmQvRGVwZW5kZW5jeVVwZGF0ZSIsInJ1bi1lbmQtdG8tZW5kLXRlc3RzIl19-->

Reviewed-on: https://code.forgejo.org/forgejo/runner/pulls/1365
Reviewed-by: Mathieu Fenniak <[email protected]>
Co-authored-by: Renovate Bot <[email protected]>
Co-committed-by: Renovate Bot <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants