Skip to content

v0.8.4

Choose a tag to compare

@genedna genedna released this 25 Jul 09:19
· 26 commits to main since this release
1e5e25b

Patch release fixing a flaky SHA-256 pack-encoding panic that could crash downstream tools (e.g. libra bundle create) under async runtimes.

Fixed

• Pack trailer no longer panics with Invalid byte length: got 32, expected 20 on SHA-256 repositories. PackEncoder finalizes its running checksum on whichever async
worker thread happens to run the task, but ObjectHash::from_bytes re-read the thread-local HashKind at finalize time. On threads where set_hash_kind was never
called (default SHA-1), finalizing a SHA-256 pack aborted with a panic — surfacing as intermittent, scheduling-dependent failures such as pack encoder task failed
in async runtimes that migrate tasks across worker threads. Both the delta path (encode/mod.rs) and the non-delta parallel path (encode/parallel.rs) now infer
the hash kind from the checksum byte length, and propagate a GitError instead of unwrapping.

Added

• ObjectHash::from_bytes_infer_kind — constructs an ObjectHash from raw bytes by inferring the hash kind from the byte length (20 → SHA-1, 32 → SHA-256) instead of
consulting the thread-local HashKind. Safe to call from any thread regardless of whether set_hash_kind has been invoked there.
• Regression test internal::pack::encode::tests::test_parallel_encode_trailer_ignores_thread_local_kind, which drives a SHA-256 encoder on a fresh thread holding
the default SHA-1 thread-local kind — the exact condition that previously panicked.

Changed

• Package repository metadata now points to https://github.com/libra-tools/git-internal.
• Resolved pre-existing clippy -D warnings debt so the lint gate passes again: match → ? in delta::decode, and iter() → values() map iteration in internal::index
(no behavior change).
• Added CHANGELOG.md to the repository; future releases will be recorded there.

Compatibility

• No breaking API changes. ObjectHash::from_bytes keeps its existing thread-local validation semantics; the new constructor is additive.
• Semver-compatible with 0.8.3 — downstream crates can upgrade by bumping the requirement to git-internal = "0.8.4".