Re: [PATCH 03/28] packed_ref_store: move `packed_refs_path` here
flat view
From: Stefan Beller <hidden>
Date: 2017-06-16 05:30:06
On Thu, Jun 15, 2017 at 7:47 AM, Michael Haggerty [off-list ref] wrote:
quoted hunk ↗ jump to hunk
Move `packed_refs_path` from `files_ref_store` to `packed_ref_store`, and rename it to `path` since its meaning is clear from its new context. Inline `files_packed_refs_path()`. Signed-off-by: Michael Haggerty <redacted> --- refs/files-backend.c | 25 ++++++++++++------------- 1 file changed, 12 insertions(+), 13 deletions(-)diff --git a/refs/files-backend.c b/refs/files-backend.c index 2efb71cee9..c4b8e2f63b 100644 --- a/refs/files-backend.c +++ b/refs/files-backend.c@@ -54,6 +54,9 @@ struct packed_ref_cache { struct packed_ref_store { unsigned int store_flags; + /* The path of the "packed-refs" file: */ + char *path; + /* * A cache of the values read from the `packed-refs` file, if * it might still be current; otherwise, NULL.@@ -61,11 +64,13 @@ struct packed_ref_store { struct packed_ref_cache *cache; }; -static struct packed_ref_store *packed_ref_store_create(unsigned int store_flags) +static struct packed_ref_store *packed_ref_store_create( + const char *path, unsigned int store_flags) { struct packed_ref_store *refs = xcalloc(1, sizeof(*refs)); refs->store_flags = store_flags; + refs->path = xstrdup(path);
mental note: the destructor (if introduced later) has to free the path.