Re: [PATCH] branch_get_push: do not segfault when HEAD is detached
- From
Jeff King <peff@peff.net>
- Date
- Jan 7, 2017, 01:11 UTC
- Message-ID
- <20170107011138.uuy6ob234kyy3y4e@sigill.intra.peff.net>
- In-Reply-To
- <87inprllpv.fsf@kyleam.com>
On Fri, Jan 06, 2017 at 08:09:32PM -0500, Kyle Meyer wrote:
Show 6 quoted lines
> > $ git grep -c HEAD^{} junio/pu -- t/
> > junio/pu:t/t3200-branch.sh:3
> >
> > Maybe use HEAD^0 just for consistency?
>
> Yes, thanks for pointing that out.The other option is just "git checkout --detach", which is also used in the test suite. I tend to prefer it because it's a little more obvious to a reader.
-Peff