From: Richard Purdie Date: Fri, 03 Feb 2012 14:40:19 GMT Subject: Re: Alternates corruption issue Message-ID: <1328280019.3895.112.camel@ted> In-Reply-To: <20120202215913.GA26727@sigill.intra.peff.net> On Thu, 2012-02-02 at 16:59 -0500, Jeff King wrote: > On Tue, Jan 31, 2012 at 04:22:58PM -0600, Jonathan Nieder wrote: > > > Anyway, thanks for explaining. Hopefully I can get to this soon and > > factor out a common function for get_repo_path and enter_repo to call > > so playing with the ordering becomes a little less scary. ;-) > > So here's what I think we should apply to fix the particular issue that > Richard mentioned at the start of this thread. > > Besides tweaking the ordering, the main contribution is a set of tests > that actually check some of these ambiguous cases (especially checking > the fact that both code paths behave identically!). I didn't factor the > logic into a common function, but doing so should be a little safer on > top of these tests, if you're still interested. I didn't have much to add to the discussion yesterday but this solution looks good to me and should resolve the problems I was seeing. Thanks! Richard