Re: [PATCH] clone: allow detached checkout when --branch takes a tag
- From
Jeff King <peff@peff.net>
- Date
- Jan 6, 2012, 14:42 UTC
- Message-ID
- <20120106144226.GA4525@sigill.intra.peff.net>
- In-Reply-To
- <CACsJy8BSzQiTScOhvQjLz8mQZC0g3fEOayBxn7n65t1tKwWnsw@mail.gmail.com>
On Fri, Jan 06, 2012 at 06:09:16PM +0700, Nguyen Thai Ngoc Duy wrote:
Show 7 quoted lines
> > 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