Skip to content
Open
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
2 changes: 1 addition & 1 deletion odb/source-files.c
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down
2 changes: 1 addition & 1 deletion odb/source-inmemory.c
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down
2 changes: 1 addition & 1 deletion odb/source-loose.c
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
2 changes: 1 addition & 1 deletion odb/source.h
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down
8 changes: 4 additions & 4 deletions t/t1007-hash-object.sh
Original file line number Diff line number Diff line change
Expand Up @@ -261,23 +261,23 @@ 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 &&
git hash-object --stdin --literally <big >actual &&
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 &&
git hash-object --stdin <big >actual &&
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 &&
Expand All @@ -287,7 +287,7 @@ test_expect_success EXPENSIVE,SIZE_T_IS_64BIT,!LONG_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 &&
Expand Down
Loading