object-file: rename `write_object_file()`
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>
Patrick Steinhardt committed
Nov 3, 2025 at 08:42 UTC
bfb1b2b4ac5cfa99f7d2503b404d282714d84bdf
3 files changed
+11
-10
object-file.c
+4
-4
@@ -1084,10 +1084,10 @@ cleanup:
1084
return err;
1085
}
1086
1087
-int write_object_file(struct odb_source *source,
1088
- const void *buf, unsigned long len,
1089
- enum object_type type, struct object_id *oid,
1090
- struct object_id *compat_oid_in, unsigned flags)
1087
+int odb_source_loose_write_object(struct odb_source *source,
1088
+ const void *buf, unsigned long len,
1089
+ enum object_type type, struct object_id *oid,
1090
+ struct object_id *compat_oid_in, unsigned flags)
1091
{
1092
const struct git_hash_algo *algo = source->odb->repo->hash_algo;
1093
const struct git_hash_algo *compat = source->odb->repo->compat_hash_algo;
object-file.h
+5
-5
@@ -62,6 +62,11 @@ int odb_source_loose_has_object(struct odb_source *source,
62
int odb_source_loose_freshen_object(struct odb_source *source,
63
const struct object_id *oid);
64
65
+int odb_source_loose_write_object(struct odb_source *source,
66
+ const void *buf, unsigned long len,
67
+ enum object_type type, struct object_id *oid,
68
+ struct object_id *compat_oid_in, unsigned flags);
69
+
70
/*
71
* Populate and return the loose object cache array corresponding to the
72
* given object ID.
@@ -168,11 +173,6 @@ enum unpack_loose_header_result unpack_loose_header(git_zstream *stream,
173
struct object_info;
174
int parse_loose_header(const char *hdr, struct object_info *oi);
175
171
-int write_object_file(struct odb_source *source,
172
- const void *buf, unsigned long len,
173
- enum object_type type, struct object_id *oid,
174
- struct object_id *compat_oid_in, unsigned flags);
175
-
176
struct input_stream {
177
const void *(*read)(struct input_stream *, unsigned long *len);
178
void *data;
odb.c
+2
-1
@@ -1021,7 +1021,8 @@ int odb_write_object_ext(struct object_database *odb,
1021
struct object_id *compat_oid,
1022
unsigned flags)
1023
{
1024
- return write_object_file(odb->sources, buf, len, type, oid, compat_oid, flags);
1024
+ return odb_source_loose_write_object(odb->sources, buf, len, type,
1025
+ oid, compat_oid, flags);
1026
}
1027
1028
struct object_database *odb_new(struct repository *repo)