From: Duy Nguyen Date: Thu, 03 Mar 2016 13:00:03 GMT Subject: Re: [PATCH 03/10] lazily load core.sharedrepository Message-ID: In-Reply-To: <20160301143954.GC12887@sigill.intra.peff.net> On Tue, Mar 1, 2016 at 9:39 PM, Jeff King wrote: > + if (need_shared_repository_from_config) { > + const char *var = "core.sharedrepository"; > + const char *value; > + if (!git_config_get_value(var, &value)) > + the_shared_repository = git_config_perm(var, value); > + need_shared_repository_from_config = 0; > + } If config cache is invalidated and reloaded by some crazy code (alias code, most likely, but I didn't check), we could be in trouble. Is there any clean way we could hook in git_config_clear() and reset need_shared.. back to 1 (or something of similar effect)? Or perhaps maintain a "clear counter", increased at every clear, and we keep a copy here, so we know if any more clear() has been called between get_shared..() calls. > return the_shared_repository; > } -- Duy