Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .b4-cover-template
Original file line number Diff line number Diff line change
Expand Up @@ -8,4 +8,5 @@ ${diffstat}
${range_diff}
---
base-commit: ${base_commit}
change-id: ${change_id}
${prerequisites}
8 changes: 8 additions & 0 deletions Documentation/RelNotes/2.56.0.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -163,6 +163,10 @@ Performance, Internal Implementation, Development Support etc.
dereferences and invalid file descriptor accesses flagged by
Coverity.

* The in-tree 'b4' cover letter template has been updated to include the
'change-id' trailer, ensuring that sent tags generated by 'b4' contain
the required tracking information for subsequent runs.


Fixes since v2.55
-----------------
Expand Down Expand Up @@ -298,3 +302,7 @@ Fixes since v2.55
split commit-graph chain, causing topological levels for commits in
base layers to be recomputed during incremental writes. This has been
corrected.

* The stream-based object signature verification path has been
corrected to avoid double-closing the stream on read errors.
(merge cfd52a74a0 ps/odb-stream-double-close-fix later to maint).
5 changes: 1 addition & 4 deletions object-file.c
Original file line number Diff line number Diff line change
Expand Up @@ -129,11 +129,8 @@ int stream_object_signature(struct repository *r,
for (;;) {
char buf[1024 * 16];
ssize_t readlen = odb_read_stream_read(st, buf, sizeof(buf));

if (readlen < 0) {
odb_read_stream_close(st);
if (readlen < 0)
return -1;
}
if (!readlen)
break;
git_hash_update(&c, buf, readlen);
Expand Down
17 changes: 17 additions & 0 deletions t/t1450-fsck.sh
Original file line number Diff line number Diff line change
Expand Up @@ -538,6 +538,23 @@ test_expect_success 'rev-list --verify-objects with bad sha1' '
test_grep -q "error: hash mismatch $(dirname $new)$(test_oid ff_2)" out
'

test_expect_success 'rev-list --verify-objects with truncated loose blob' '
git init truncated-blob &&
(
cd truncated-blob &&
blob=$(test-tool genrandom one 5k | git hash-object -t blob -w --stdin) &&
obj=.git/objects/$(test_oid_to_path $blob) &&

# Truncate the loose blob such that its header can still be
# parsed, but reading the object data fails mid-stream.
test_copy_bytes 64 <"$obj" >obj.tmp &&
mv obj.tmp "$obj" &&

test_must_fail git rev-list --verify-objects "$blob" 2>err &&
test_grep "hash mismatch" err
)
'

# An actual bit corruption is more likely than swapped commits, but
# this provides an easy way to have commits which don't match their purported
# hashes, but which aren't so broken we can't read them at all.
Expand Down