Re: "checkout --track -b" broken? (with suggested fix)
- From
Daniel Barkalow <barkalow@iabervon.org>
- Date
- Oct 18, 2008, 02:17 UTC
- Message-ID
- <alpine.LNX.1.00.0810172119020.19665@iabervon.org>
- In-Reply-To
- <7vskqug4fy.fsf@gitster.siamese.dyndns.org>
On Fri, 17 Oct 2008, Junio C Hamano wrote:
Show 15 quoted lines
> Daniel Barkalow <barkalow@iabervon.org> writes: > > > On Thu, 16 Oct 2008, Junio C Hamano wrote: > > > >> The patch to branch.c is a quick fix for this issue. The resulting code > >> passes all the tests, but I am not very proud of hardcoding the "HEAD" in > >> the code. There must be a better way to do this. > > > > I agree with the change to the test. I think it would be better to > > hard-code "refs/heads/" instead of "HEAD", and I feel like we must have a > > "is this ref name a branch?" function, if only because someone could stick > > "refs/tags/foo" in HEAD, and we should still say it's not something you > > could track, despite it being something different from "HEAD". > > But you can track things under refs/remotes/, so...
Ah, true. Maybe hard-code "refs/". Or have an "is this ref name a branch?" function that's paying more attention than I am, and returns true from both local branches and (local copies of) remote branches.
-Daniel *This .sig left intentionally blank*