Re: [PATCH 07/17] odb: get rid of `the_repository` in `assert_oid_type()`
- From
Derrick Stolee <stolee@gmail.com>
- Date
- May 7, 2025, 01:12 UTC
- Message-ID
- <9cd68129-1166-4f80-9b89-8f12c9d118c7@gmail.com>
- In-Reply-To
- <20250506-pks-object-store-wo-the-repository-v1-7-c05b82e7b126@pks.im>
On 5/6/25 7:09 AM, Patrick Steinhardt wrote:
> Get rid of our dependency on `the_repository` in `assert_oid_type()` by > passing in the object database as a parameter and adjusting all callers.
Oops! This patch has the same message as patch 6 but is actually a different change, removing the_repository from odb_mkstemp():
> - pack_fd = odb_mkstemp(&tmp_file, "pack/tmp_pack_XXXXXX"); > + pack_fd = odb_mkstemp(the_repository->objects, &tmp_file, > + "pack/tmp_pack_XXXXXX");
...
Show 13 quoted lines
> /* > - * 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 > - * "template" buffer. Returns the open descriptor. > + * Create a temporary file rooted in the primary object database backend'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);
I'm happy with the code change, though.
Thanks, -Stolee