Re: [PATCH 2/3] validate_headref: use skip_prefix for symref parsing

2017-09-27 Thread Junio C Hamano
Jeff King writes: > Since the previous commit guarantees that our symref buffer > is NUL-terminated, we can just use skip_prefix() and friends > to parse it. This is shorter and saves us having to deal > with magic numbers and keeping the "len" counter up to date. Ah, I should have read the whol

[PATCH 2/3] validate_headref: use skip_prefix for symref parsing

2017-09-26 Thread Jeff King
Since the previous commit guarantees that our symref buffer is NUL-terminated, we can just use skip_prefix() and friends to parse it. This is shorter and saves us having to deal with magic numbers and keeping the "len" counter up to date. While we're at it, let's name the rather obscure "buf" to "