[PATCH 12/13] object-file: rename `write_object_file()`
- From
Patrick Steinhardt <ps@pks.im>
- Date
- Oct 24, 2025, 09:56 UTC
- Message-ID
- <20251024-b4-pks-odb-loose-backend-v1-12-1a4202273c38@pks.im>
- In-Reply-To
- <20251024-b4-pks-odb-loose-backend-v1-0-1a4202273c38@pks.im>
Rename `write_object_file()` to `odb_loose_source_write_object()` so that it becomes clear that this is tied to a specific loose object source. This matches our modern naming schema for functions.
Signed-off-by: Patrick Steinhardt <ps@pks.im> --- object-file.c | 8 ++++---- object-file.h | 10 +++++----- odb.c | 3 ++- 3 files changed, 11 insertions(+), 10 deletions(-)
diff --git a/object-file.c b/object-file.c index 2ca90adc2c7..67be5371346 100644 --- a/object-file.c +++ b/object-file.c @@ -1084,10 +1084,10 @@ int stream_loose_object(struct odb_source *source, return err; } -int write_object_file(struct odb_source *source, - const void *buf, unsigned long len, - enum object_type type, struct object_id *oid, - struct object_id *compat_oid_in, unsigned flags) +int odb_loose_source_write_object(struct odb_source *source, + const void *buf, unsigned long len, + enum object_type type, struct object_id *oid, + struct object_id *compat_oid_in, unsigned flags) { const struct git_hash_algo *algo = source->odb->repo->hash_algo; const struct git_hash_algo *compat = source->odb->repo->compat_hash_algo; diff --git a/object-file.h b/object-file.h index b27c08380d8..78f0e650d72 100644 --- a/object-file.h +++ b/object-file.h @@ -62,6 +62,11 @@ int odb_loose_source_has_object(struct odb_source *source, int odb_loose_source_freshen_object(struct odb_source *source, const struct object_id *oid); +int odb_loose_source_write_object(struct odb_source *source, + const void *buf, unsigned long len, + enum object_type type, struct object_id *oid, + struct object_id *compat_oid_in, unsigned flags); + /* * Populate and return the loose object cache array corresponding to the * given object ID. @@ -168,11 +173,6 @@ enum unpack_loose_header_result unpack_loose_header(git_zstream *stream, struct object_info; int parse_loose_header(const char *hdr, struct object_info *oi); -int write_object_file(struct odb_source *source, - const void *buf, unsigned long len, - enum object_type type, struct object_id *oid, - struct object_id *compat_oid_in, unsigned flags); - struct input_stream { const void *(*read)(struct input_stream *, unsigned long *len); void *data; diff --git a/odb.c b/odb.c index 6f8f665351b..432011b4dac 100644 --- a/odb.c +++ b/odb.c @@ -1021,7 +1021,8 @@ int odb_write_object_ext(struct object_database *odb, struct object_id *compat_oid, unsigned flags) { - return write_object_file(odb->sources, buf, len, type, oid, compat_oid, flags); + return odb_loose_source_write_object(odb->sources, buf, len, type, + oid, compat_oid, flags); } struct object_database *odb_new(struct repository *repo)
-- 2.51.1.930.gacf6e81ea2.dirty