odb: introduce odb_source_new()

We have three different locations where we create a new ODB source.
Deduplicate the logic via a new `odb_source_new()` function.

Signed-off-by: Patrick Steinhardt <ps@pks.im>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
This commit is contained in:
Patrick Steinhardt
2025-11-03 08:41:57 +01:00
committed by Junio C Hamano
parent f82e430b4e
commit 0820a4b120
3 changed files with 29 additions and 12 deletions

4
odb.h
View File

@@ -89,6 +89,10 @@ struct odb_source {
char *path;
};
struct odb_source *odb_source_new(struct object_database *odb,
const char *path,
bool local);
struct packed_git;
struct packfile_store;
struct cached_object_entry;