mirror of
https://github.com/git/git.git
synced 2025-12-12 20:36:24 +01:00
object-file: get rid of the_repository in force_object_loose()
The function `force_object_loose()` forces an object to become a loose object in case it only exists in its packed form. To do so it implicitly relies on `the_repository`. Refactor the function by passing a `struct odb_source` as parameter. While the check whether any such loose object exists already acts on the whole object database, writing the loose object happens in one specific source. 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
0df005353a
commit
c2b5d1490a
@@ -161,7 +161,8 @@ 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);
|
||||
int force_object_loose(struct odb_source *source,
|
||||
const struct object_id *oid, time_t mtime);
|
||||
|
||||
/**
|
||||
* With in-core object data in "buf", rehash it to make sure the
|
||||
|
||||
Reference in New Issue
Block a user