From 6abbdd61a5e9b360659a2a015e35d49a496357e9 Mon Sep 17 00:00:00 2001 From: Johannes Schindelin Date: Thu, 2 Jul 2026 13:04:30 +0200 Subject: [PATCH 1/5] fixup! object-file.c: use size_t for header lengths These gaps were identified while upstreaming the patches. Signed-off-by: Johannes Schindelin --- odb/source-files.c | 2 +- odb/source-inmemory.c | 2 +- odb/source-loose.c | 2 +- odb/source.h | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) diff --git a/odb/source-files.c b/odb/source-files.c index 5bdd0429225397..3b1261eba9700e 100644 --- a/odb/source-files.c +++ b/odb/source-files.c @@ -159,7 +159,7 @@ static int odb_source_files_freshen_object(struct odb_source *source, } static int odb_source_files_write_object(struct odb_source *source, - const void *buf, unsigned long len, + const void *buf, size_t len, enum object_type type, struct object_id *oid, struct object_id *compat_oid, diff --git a/odb/source-inmemory.c b/odb/source-inmemory.c index e004566d768b01..7f1b6f46363f2e 100644 --- a/odb/source-inmemory.c +++ b/odb/source-inmemory.c @@ -227,7 +227,7 @@ static int odb_source_inmemory_count_objects(struct odb_source *source, } static int odb_source_inmemory_write_object(struct odb_source *source, - const void *buf, unsigned long len, + const void *buf, size_t len, enum object_type type, struct object_id *oid, struct object_id *compat_oid UNUSED, diff --git a/odb/source-loose.c b/odb/source-loose.c index 2bf89626c620c7..6211348a4d3561 100644 --- a/odb/source-loose.c +++ b/odb/source-loose.c @@ -583,7 +583,7 @@ static int odb_source_loose_freshen_object(struct odb_source *source, } static int odb_source_loose_write_object(struct odb_source *source, - const void *buf, unsigned long len, + const void *buf, size_t len, enum object_type type, struct object_id *oid, struct object_id *compat_oid_in, enum odb_write_object_flags flags) diff --git a/odb/source.h b/odb/source.h index 2192a101b8ab08..1c65a05e2c4c6b 100644 --- a/odb/source.h +++ b/odb/source.h @@ -199,7 +199,7 @@ struct odb_source { * return 0 on success, a negative error code otherwise. */ int (*write_object)(struct odb_source *source, - const void *buf, unsigned long len, + const void *buf, size_t len, enum object_type type, struct object_id *oid, struct object_id *compat_oid, From 3ae86cd84ca54629e3bcebee64ed76ed0445d239 Mon Sep 17 00:00:00 2001 From: Johannes Schindelin Date: Thu, 2 Jul 2026 13:05:26 +0200 Subject: [PATCH 2/5] fixup! hash algorithms: use size_t for section lengths While upstreaming the patch, it was pointed out that we should now drop that prereq. Signed-off-by: Johannes Schindelin --- t/t1007-hash-object.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/t/t1007-hash-object.sh b/t/t1007-hash-object.sh index 841a6671d1a3c1..f0f0a7bbc503e4 100755 --- a/t/t1007-hash-object.sh +++ b/t/t1007-hash-object.sh @@ -261,7 +261,7 @@ test_expect_success '--stdin outside of repository (uses default hash)' ' test_cmp expect actual ' -test_expect_success EXPENSIVE,SIZE_T_IS_64BIT,!LONG_IS_64BIT \ +test_expect_success EXPENSIVE,SIZE_T_IS_64BIT \ 'files over 4GB hash literally' ' test-tool genzeros $((5*1024*1024*1024)) >big && test_oid large5GB >expect && From 6bcaa3b8c6cba387a83b9c3f94b91bf2706c67d8 Mon Sep 17 00:00:00 2001 From: Johannes Schindelin Date: Thu, 2 Jul 2026 13:06:07 +0200 Subject: [PATCH 3/5] fixup! hash-object --stdin: verify that it works with >4GB/LLP64 While upstreaming the patch, it was pointed out that we should now drop that prereq. Signed-off-by: Johannes Schindelin --- t/t1007-hash-object.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/t/t1007-hash-object.sh b/t/t1007-hash-object.sh index f0f0a7bbc503e4..cce0c56619d171 100755 --- a/t/t1007-hash-object.sh +++ b/t/t1007-hash-object.sh @@ -269,7 +269,7 @@ test_expect_success EXPENSIVE,SIZE_T_IS_64BIT \ test_cmp expect actual ' -test_expect_success EXPENSIVE,SIZE_T_IS_64BIT,!LONG_IS_64BIT \ +test_expect_success EXPENSIVE,SIZE_T_IS_64BIT \ 'files over 4GB hash correctly via --stdin' ' { test -f big || test-tool genzeros $((5*1024*1024*1024)) >big; } && test_oid large5GB >expect && From ede99ee512eda5a6459b15b7bae5b2d7ff2e01d1 Mon Sep 17 00:00:00 2001 From: Johannes Schindelin Date: Thu, 2 Jul 2026 13:06:24 +0200 Subject: [PATCH 4/5] fixup! hash-object: add another >4GB/LLP64 test case While upstreaming the patch, it was pointed out that we should now drop that prereq. Signed-off-by: Johannes Schindelin --- t/t1007-hash-object.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/t/t1007-hash-object.sh b/t/t1007-hash-object.sh index cce0c56619d171..c0b84b6c522d76 100755 --- a/t/t1007-hash-object.sh +++ b/t/t1007-hash-object.sh @@ -277,7 +277,7 @@ test_expect_success EXPENSIVE,SIZE_T_IS_64BIT \ test_cmp expect actual ' -test_expect_success EXPENSIVE,SIZE_T_IS_64BIT,!LONG_IS_64BIT \ +test_expect_success EXPENSIVE,SIZE_T_IS_64BIT \ 'files over 4GB hash correctly' ' { test -f big || test-tool genzeros $((5*1024*1024*1024)) >big; } && test_oid large5GB >expect && From c8dff95af823bd04181a583c03f3fbb954551c30 Mon Sep 17 00:00:00 2001 From: Johannes Schindelin Date: Thu, 2 Jul 2026 13:06:33 +0200 Subject: [PATCH 5/5] fixup! hash-object: add a >4GB/LLP64 test case using filtered input While upstreaming the patch, it was pointed out that we should now drop that prereq. Signed-off-by: Johannes Schindelin --- t/t1007-hash-object.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/t/t1007-hash-object.sh b/t/t1007-hash-object.sh index c0b84b6c522d76..4bc82dd9682954 100755 --- a/t/t1007-hash-object.sh +++ b/t/t1007-hash-object.sh @@ -287,7 +287,7 @@ test_expect_success EXPENSIVE,SIZE_T_IS_64BIT \ # This clean filter does nothing, other than excercising the interface. # We ensure that cleaning doesn't mangle large files on 64-bit Windows. -test_expect_success EXPENSIVE,SIZE_T_IS_64BIT,!LONG_IS_64BIT \ +test_expect_success EXPENSIVE,SIZE_T_IS_64BIT \ 'hash filtered files over 4GB correctly' ' { test -f big || test-tool genzeros $((5*1024*1024*1024)) >big; } && test_oid large5GB >expect &&