checkout: check_linked_checkout: simplify symref parsing
commit33aef83666900df03c39bcf7e391e2f8195dd13c
authorEric Sunshine <sunshine@sunshineco.com>
Fri, 17 Jul 2015 23:00:02 +0000 (17 19:00 -0400)
committerJunio C Hamano <gitster@pobox.com>
Mon, 20 Jul 2015 18:29:24 +0000 (20 11:29 -0700)
treefc709a2b5aed1e79ce51863e6e4485762c4234df
parent39e69e151951040b952b3c81d2ee40b827fd9abf
checkout: check_linked_checkout: simplify symref parsing

check_linked_checkout() only understands symref-style HEAD (i.e. "ref:
refs/heads/master"), however, HEAD may also be a an actual symbolic link
(on platforms which support it), thus it will need to check that style
HEAD, as well (via readlink()). As a preparatory step, simplify parsing
of symref-style HEAD so the actual branch check can be re-used easily
for symbolic links (in an upcoming patch).

Signed-off-by: Eric Sunshine <sunshine@sunshineco.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
builtin/checkout.c