checkout,clone: check return value of create_symref
commit4be49d756894daca0e8a4477d36c6ed1096ccddc
authorJeff King <peff@peff.net>
Tue, 12 Jan 2016 09:57:34 +0000 (12 04:57 -0500)
committerJunio C Hamano <gitster@pobox.com>
Tue, 12 Jan 2016 19:11:52 +0000 (12 11:11 -0800)
treed013f146189a190d3260baaa597067a1fb10a0ad
parent396da8f7a07ae02a6152e0c0fc3eaac8a99b4c65
checkout,clone: check return value of create_symref

It's unlikely that we would fail to create or update a
symbolic ref (especially HEAD), but if we do, we should
notice and complain. Note that there's no need to give more
details in our error message; create_symref will already
have done so.

While we're here, let's also fix a minor memory leak in
clone.

Signed-off-by: Jeff King <peff@peff.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
builtin/checkout.c
builtin/clone.c
t/t2011-checkout-invalid-head.sh