Re: [PATCH 03/10] lazily load core.sharedrepository
- From
Duy Nguyen <pclouds@gmail.com>
- Date
- Mar 3, 2016, 13:00 UTC
- Message-ID
- <CACsJy8DM4sG5MztfQnZHpaj3NAveS9S4-qLtSCmLEWhFyfKwTw@mail.gmail.com>
- In-Reply-To
- <20160301143954.GC12887@sigill.intra.peff.net>
On Tue, Mar 1, 2016 at 9:39 PM, Jeff King <peff@peff.net> wrote:
Show 7 quoted lines
> + 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