]> git.ipfire.org Git - thirdparty/git.git/commitdiff
object-file: rename `write_object_file()`
authorPatrick Steinhardt <ps@pks.im>
Mon, 3 Nov 2025 07:42:07 +0000 (08:42 +0100)
committerJunio C Hamano <gitster@pobox.com>
Mon, 3 Nov 2025 20:18:47 +0000 (12:18 -0800)
Rename `write_object_file()` to `odb_source_loose_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>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
object-file.c
object-file.h
odb.c

index 893c32adcddbbd34c250c98d24d842cfb2046fff..fdc644a4275373dc87733c71e2c28b75c899e1db 100644 (file)
@@ -1084,10 +1084,10 @@ cleanup:
        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_source_loose_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;
index ee5b24cec66c340b94752cbdeaebb5cc476630e8..36a60e15c40547001a07ef326a62a4c18a4da95d 100644 (file)
@@ -62,6 +62,11 @@ int odb_source_loose_has_object(struct odb_source *source,
 int odb_source_loose_freshen_object(struct odb_source *source,
                                    const struct object_id *oid);
 
+int odb_source_loose_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 17734bdaffe8e64673726b615ff3dc98649cde76..da44f1d63b43b297c01586bf14410f676f0c7066 100644 (file)
--- 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_source_loose_write_object(odb->sources, buf, len, type,
+                                            oid, compat_oid, flags);
 }
 
 struct object_database *odb_new(struct repository *repo)