diff options
| author | Patrick Steinhardt <ps@pks.im> | 2025-07-17 06:56:36 +0200 |
|---|---|---|
| committer | Junio C Hamano <gitster@pobox.com> | 2025-07-16 22:16:16 -0700 |
| commit | e7e952f5c27bbca3d98bbcea6d20cd5b63d7d8e5 (patch) | |
| tree | 8a52ac4e02fa740f40c929cde207303b9342f088 /object-file.h | |
| parent | odb: introduce `odb_write_object()` (diff) | |
| download | git-e7e952f5c27bbca3d98bbcea6d20cd5b63d7d8e5.tar.gz git-e7e952f5c27bbca3d98bbcea6d20cd5b63d7d8e5.zip | |
object-file: get rid of `the_repository` when writing objects
The logic that writes loose objects still relies on `the_repository` to
decide where exactly the object shall be written to. Refactor it so that
the logic instead operates on a `struct odb_source` so that we can get
rid of this global dependency.
Signed-off-by: Patrick Steinhardt <ps@pks.im>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 'object-file.h')
| -rw-r--r-- | object-file.h | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/object-file.h b/object-file.h index 8ee24b7d8f..622e2b2bb7 100644 --- a/object-file.h +++ b/object-file.h @@ -157,7 +157,8 @@ 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(const void *buf, unsigned long len, +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); @@ -167,7 +168,8 @@ struct input_stream { int is_finished; }; -int stream_loose_object(struct input_stream *in_stream, size_t len, +int stream_loose_object(struct odb_source *source, + struct input_stream *in_stream, size_t len, struct object_id *oid); int force_object_loose(const struct object_id *oid, time_t mtime); |
