Re: [PATCH 03/14] object-file: extract function to read object info from path
- From
Patrick Steinhardt <ps@pks.im>
- Date
- Jan 16, 2026, 07:03 UTC
- Message-ID
- <aWnivHGQMeTEMZux@pks.im>
- In-Reply-To
- <aWkvucfZy7e2Rd6t@denethor>
On Thu, Jan 15, 2026 at 12:31:13PM -0600, Justin Tobler wrote:
Show 19 quoted lines
> On 26/01/15 12:04PM, Patrick Steinhardt wrote: > > diff --git a/object-file.c b/object-file.c > > index 8fa461dd59..a651129426 100644 > > --- a/object-file.c > > +++ b/object-file.c > [snip] > > @@ -455,7 +438,7 @@ int odb_source_loose_read_object_info(struct odb_source *source, > > goto out; > > } > > > > - fd = open_loose_object(source->loose, oid, &path); > > + fd = git_open(path); > > Here we already have the path, so there is no need to invoke > odb_loose_path() again via open_loose_object(). We can instead call > git_open() directly. Looks good. > > If I understand correctly, even before this change the path was already > available so using open_loose_object() here was already redundant.
It actually wasn't. `open_loose_object()` was responsible for calling `odb_loose_path()`, and that path was then also assigned to the out pointer.
Patrick