You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
fix(pack): infer trailer hash kind from checksum length, release 0.8.4
PackEncoder finalizes its running checksum on whichever async worker
thread runs 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 panicked with
"Invalid byte length: got 32, expected 20", surfacing as flaky SHA-256
pack failures (e.g. 'libra bundle create' on SHA-256 repositories).
Add ObjectHash::from_bytes_infer_kind, which derives the kind from the
checksum byte length (20 -> SHA-1, 32 -> SHA-256) instead of the
thread-local kind, and use it in both the delta (encode/mod.rs) and
non-delta parallel (encode/parallel.rs) trailer paths, replacing the
unwrap() with a propagated GitError. Includes a regression test that
drives a SHA-256 encoder on a fresh thread holding the default SHA-1
thread-local kind.
Also: bump version to 0.8.4, point repository metadata at
https://github.com/libra-tools/git-internal, add CHANGELOG.md, and
resolve pre-existing clippy -D warnings debt (delta::decode match -> ?,
internal::index iter() -> values()) with no behavior change.
Signed-off-by: Quanyi Ma <eli@patch.sh>
0 commit comments