Skip to content

Commit bfb1b2b

Browse files
pks-tgitster
authored andcommitted
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>
1 parent f2bd88a commit bfb1b2b

File tree

3 files changed

+11
-10
lines changed

3 files changed

+11
-10
lines changed

object-file.c

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1084,10 +1084,10 @@ int stream_loose_object(struct odb_source *source,
10841084
return err;
10851085
}
10861086

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)
10911091
{
10921092
const struct git_hash_algo *algo = source->odb->repo->hash_algo;
10931093
const struct git_hash_algo *compat = source->odb->repo->compat_hash_algo;

object-file.h

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -62,6 +62,11 @@ int odb_source_loose_has_object(struct odb_source *source,
6262
int odb_source_loose_freshen_object(struct odb_source *source,
6363
const struct object_id *oid);
6464

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+
6570
/*
6671
* Populate and return the loose object cache array corresponding to the
6772
* given object ID.
@@ -168,11 +173,6 @@ enum unpack_loose_header_result unpack_loose_header(git_zstream *stream,
168173
struct object_info;
169174
int parse_loose_header(const char *hdr, struct object_info *oi);
170175

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-
176176
struct input_stream {
177177
const void *(*read)(struct input_stream *, unsigned long *len);
178178
void *data;

odb.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1021,7 +1021,8 @@ int odb_write_object_ext(struct object_database *odb,
10211021
struct object_id *compat_oid,
10221022
unsigned flags)
10231023
{
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);
10251026
}
10261027

10271028
struct object_database *odb_new(struct repository *repo)

0 commit comments

Comments
 (0)