aboutsummaryrefslogtreecommitdiffstats
path: root/odb.c
diff options
context:
space:
mode:
authorPatrick Steinhardt <ps@pks.im>2025-07-17 06:56:36 +0200
committerJunio C Hamano <gitster@pobox.com>2025-07-16 22:16:16 -0700
commite7e952f5c27bbca3d98bbcea6d20cd5b63d7d8e5 (patch)
tree8a52ac4e02fa740f40c929cde207303b9342f088 /odb.c
parentodb: introduce `odb_write_object()` (diff)
downloadgit-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 'odb.c')
-rw-r--r--odb.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/odb.c b/odb.c
index 519df2fa49..2a92a018c4 100644
--- a/odb.c
+++ b/odb.c
@@ -980,14 +980,14 @@ void odb_assert_oid_type(struct object_database *odb,
type_name(expect));
}
-int odb_write_object_ext(struct object_database *odb UNUSED,
+int odb_write_object_ext(struct object_database *odb,
const void *buf, unsigned long len,
enum object_type type,
struct object_id *oid,
struct object_id *compat_oid,
unsigned flags)
{
- return write_object_file(buf, len, type, oid, compat_oid, flags);
+ return write_object_file(odb->sources, buf, len, type, oid, compat_oid, flags);
}
struct object_database *odb_new(struct repository *repo)