odb: get rid of the_repository in odb_mkstemp()

Get rid of our dependency on `the_repository` in `odb_mkstemp()` by
passing in the object database as a parameter and adjusting all callers.

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-07-01 14:22:19 +02:00
committed by Junio C Hamano
parent 961038856b
commit 1b1679c688
7 changed files with 22 additions and 15 deletions

7
odb.h
View File

@@ -201,12 +201,13 @@ void odb_clear(struct object_database *o);
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
* Create a temporary file rooted in the primary alternate's 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
* "template" buffer. Returns the open descriptor.
*/
int odb_mkstemp(struct strbuf *temp_filename, const char *pattern);
int odb_mkstemp(struct object_database *odb,
struct strbuf *temp_filename, const char *pattern);
void *repo_read_object_file(struct repository *r,
const struct object_id *oid,