Re: [PATCH v2 11/20] refs: record the ref_store in ref_cache, not ref_dir
- From
Michael Haggerty <mhagger@alum.mit.edu>
- Date
- Apr 16, 2017, 05:49 UTC
- Message-ID
- <c057d1f5-e8c6-3c08-2b18-e5cf73f74e57@alum.mit.edu>
- In-Reply-To
- <CACsJy8BM1nHhbKo9ioAP2OC2UU-RMWhmJ5OsYZwWYqek++DA0Q@mail.gmail.com>
On 04/07/2017 01:38 PM, Duy Nguyen wrote:
Show 15 quoted lines
> On Fri, Mar 31, 2017 at 9:11 PM, Michael Haggerty <mhagger@alum.mit.edu> wrote: >> Instead of keeping a pointer to the ref_store in every ref_dir entry, >> store it once in `struct ref_cache`, and change `struct ref_dir` to >> include a pointer to its containing `ref_cache` instead. This makes it >> easier to add to the information that is accessible from a `ref_dir` >> without increasing the size of every `ref_dir` instance. > ... >> @@ -526,7 +526,7 @@ static struct ref_dir *get_loose_refs(struct files_ref_store *refs) >> * lazily): >> */ >> add_entry_to_dir(get_ref_dir(refs->loose->root), >> - create_dir_entry(refs, "refs/", 5, 1)); >> + create_dir_entry(refs->loose, "refs/", 5, 1)); > > The commit message mentions nothing about this change. Is it intended?
The old `create_dir_entry()` took a `files_ref_store` as its first parameter, because that is what needed to be stored into the old `dir_entry` struct. The new version takes a `ref_cache`, because that is what the new `dir_entry` struct requires. This hunk is a logical consequence of that change.
I'll improve the commit message to explain this better.
Thanks, Michael