Re: [PATCH] t6300: avoid creating refs/heads/HEAD
- From
Junio C Hamano <gitster@pobox.com>
- Date
- Feb 27, 2017, 22:18 UTC
- Message-ID
- <xmqqa897nupx.fsf@gitster.mtv.corp.google.com>
- In-Reply-To
- <20170227214147.5ezxskhihi3cc77m@sigill.intra.peff.net>
Jeff King <peff@peff.net> writes:
Show 10 quoted lines
> The "other" stuff could sometimes be useful, I guess. It's not _always_
> wrong to do:
>
> git branch -f @{upstream} foo
>
> It depends on what your @{upstream} resolves to. Switching to just using
> interpret_nth_prior_checkout() would break the case when it resolves to
> a local branch. I'm not sure if we're OK with that or not. If we want to
> keep all the existing cases working, I think we need something like the
> "not_in_refs_heads" patch I posted elsewhere.I haven't seen that patch, but yes, telling the caller if the returned value is meant to be used inside refs/heads/ is the right approach and makes it possible for "@{upstream}" (and just "@") to be handled sensibly in "git branch -m @{that at-mark thing}".