From: Jeff King Date: Fri, 06 Jan 2012 14:42:27 GMT Subject: Re: [PATCH] clone: allow detached checkout when --branch takes a tag Message-ID: <20120106144226.GA4525@sigill.intra.peff.net> In-Reply-To: On Fri, Jan 06, 2012 at 06:09:16PM +0700, Nguyen Thai Ngoc Duy wrote: > > I wonder, though, if the original code makes any sense. By using > > "refs/", I would have to say "--branch=heads/foo", which is kind of > > weird and undocumented. I think it should probably always be > > "refs/heads/", no matter if we are mirroring or not. > > --branch should not be used with --mirror in my opinion. --branch > changes HEAD so it's no longer an exact mirror. You could be making a repo that mirrors all of the refs, but has a different HEAD (e.g., the upstream has "development" as the main branch, but you want a local mirror with "production" as the HEAD). I agree it's an unlikely combination (which is probably why nobody has complained about the weird behavior), but I don't see a particular reason to forbid it. -Peff