]> git.ipfire.org Git - thirdparty/git.git/commit - remote.c
branch_get_push: do not segfault when HEAD is detached
authorKyle Meyer <kyle@kyleam.com>
Sat, 7 Jan 2017 01:12:15 +0000 (20:12 -0500)
committerJunio C Hamano <gitster@pobox.com>
Sun, 8 Jan 2017 03:20:07 +0000 (19:20 -0800)
commitb10731f43dc21fa47c275052e7c074c686335cd3
treea8dec989c054725eb2f0605aef101aca5c17d403
parent0b65a8dbdb38962e700ee16776a3042beb489060
branch_get_push: do not segfault when HEAD is detached

Move the detached HEAD check from branch_get_push_1() to
branch_get_push() to avoid setting branch->push_tracking_ref when
branch is NULL.

Signed-off-by: Kyle Meyer <kyle@kyleam.com>
Reviewed-by: Jeff King <peff@peff.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
remote.c
t/t1514-rev-parse-push.sh