Re: [PATCH] interpret_branch_name(): handle auto-namelen for @{-1}

2017-02-27 Thread Junio C Hamano
Jeff King writes: > On Mon, Feb 27, 2017 at 04:25:40AM -0500, Jeff King wrote: > >> However, before we do that auto-namelen magic, we call >> interpret_nth_prior_checkout(), which gets fed the bogus >> "0". This was broken by 8cd4249c4 (interpret_branch_name: >> always respect "namelen" parameter

Re: [PATCH] interpret_branch_name(): handle auto-namelen for @{-1}

2017-02-27 Thread Jeff King
On Mon, Feb 27, 2017 at 04:25:40AM -0500, Jeff King wrote: > However, before we do that auto-namelen magic, we call > interpret_nth_prior_checkout(), which gets fed the bogus > "0". This was broken by 8cd4249c4 (interpret_branch_name: > always respect "namelen" parameter, 2014-01-15). Though to >

[PATCH] interpret_branch_name(): handle auto-namelen for @{-1}

2017-02-27 Thread Jeff King
The interpret_branch_name() function takes a ptr/len pair for the name, but you can pass "0" for "namelen", which will cause it to check the length with strlen(). However, before we do that auto-namelen magic, we call interpret_nth_prior_checkout(), which gets fed the bogus "0". This was broken by