From: Michael Haggerty Date: Mon, 20 Mar 2017 14:29:04 GMT Subject: Re: [PATCH v6 17/27] refs: move submodule code out of files-backend.c Message-ID: <77d37131-535d-c4ed-0785-1b7cf91f01ad@alum.mit.edu> In-Reply-To: On 03/20/2017 01:09 PM, Duy Nguyen wrote: > On Mon, Mar 20, 2017 at 4:05 AM, Michael Haggerty wrote: >>> [...] >>> diff --git a/refs/refs-internal.h b/refs/refs-internal.h >>> index f732473e1d..dfa1817929 100644 >>> --- a/refs/refs-internal.h >>> +++ b/refs/refs-internal.h >>> @@ -482,12 +482,11 @@ struct ref_store; >>> /* refs backends */ >>> >>> /* >>> - * Initialize the ref_store for the specified submodule, or for the >>> - * main repository if submodule == NULL. These functions should call >>> - * base_ref_store_init() to initialize the shared part of the >>> - * ref_store and to record the ref_store for later lookup. >>> + * Initialize the ref_store for the specified gitdir. These functions >>> + * should call base_ref_store_init() to initialize the shared part of >>> + * the ref_store and to record the ref_store for later lookup. >> >> Maybe mention that the function will make its own copy of `gitdir`? > > I would think that's the default/sane behavior and not need to be > mentioned? A function that keeps a pointer even after it exits, now > that's something that must be documented. I guess you're right, and I hope that everybody really documents such cases. Michael