Re: [PATCH v6 28/32] config: read ref storage config on startup
- From
Jeff King <peff@peff.net>
- Date
- Feb 29, 2016, 22:10 UTC
- Message-ID
- <20160229221024.GE25342@sigill.intra.peff.net>
- In-Reply-To
- <1456783062.18017.65.camel@twopensource.com>
On Mon, Feb 29, 2016 at 04:57:42PM -0500, David Turner wrote:
Show 11 quoted lines
> > So I think this setup probably should be in > > check_repository_format_gently(), and should be able to trigger off > > of > > the existing ref_storage_backend string we've already saved (and we > > should bail immediately there if we don't know about the backend, as > > it > > means we _don't_ match the repo's extensions and cannot proceed). > > We apparently don't always call check_repo_format before calling > git_config_early -- or, more to the point, before doing ref operations. > So I think we need this in git_config_early.
That seems horribly broken, though. If a program is accessing refs without calling check_repository_format, isn't it bypassing all of our regular version and extension checks?
I think we should be smoking out such cases (e.g., by setting a null refs-backend, as I mentioned earlier) and fixing them, rather than working around them by putting the backend setup in the wrong place.
-Peff