diff options
| author | Patrick Steinhardt <ps@pks.im> | 2025-07-01 14:22:17 +0200 |
|---|---|---|
| committer | Junio C Hamano <gitster@pobox.com> | 2025-07-01 14:46:35 -0700 |
| commit | bd52ea343d2af91574fedcf765250f44f3d624d4 (patch) | |
| tree | bece7d934b61e20a4641262a7f45c7e39e860a44 /odb.h | |
| parent | 2f5181fce6c6353f9c743d9d396fbf06527688c7 (diff) | |
| download | git-bd52ea343d2af91574fedcf765250f44f3d624d4.tar.xz | |
odb: get rid of `the_repository` in `find_odb()`
Get rid of our dependency on `the_repository` in `find_odb()` by passing
in the object database in which we want to search for the source and
adjusting all callers.
Rename the function to `odb_find_source()`.
Signed-off-by: Patrick Steinhardt <ps@pks.im>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 'odb.h')
| -rw-r--r-- | odb.h | 7 |
1 files changed, 6 insertions, 1 deletions
@@ -68,7 +68,6 @@ struct odb_source { void prepare_alt_odb(struct repository *r); int has_alt_odb(struct repository *r); char *compute_alternate_path(const char *path, struct strbuf *err); -struct odb_source *find_odb(struct repository *r, const char *obj_dir); typedef int alt_odb_fn(struct odb_source *, void *); int foreach_alt_odb(alt_odb_fn, void*); typedef void alternate_ref_fn(const struct object_id *oid, void *); @@ -196,6 +195,12 @@ struct object_database *odb_new(struct repository *repo); void odb_clear(struct object_database *o); /* + * Find source by its object directory path. Dies in case the source couldn't + * be found. + */ +struct odb_source *odb_find_source(struct object_database *odb, const char *obj_dir); + +/* * Create a temporary file rooted in the object database directory, or * die on failure. The filename is taken from "pattern", which should have the * usual "XXXXXX" trailer, and the resulting filename is written into the |
