mirror of
https://github.com/git/git.git
synced 2025-12-12 20:36:24 +01:00
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>
This commit is contained in:
committed by
Junio C Hamano
parent
ab1c6e1d12
commit
e7e952f5c2
4
odb.c
4
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)
|
||||
|
||||
Reference in New Issue
Block a user