]> git.ipfire.org Git - thirdparty/git.git/commitdiff
parse-remote: handle detached HEAD
authorSanti Béjar <santi@agolina.net>
Mon, 6 Dec 2010 10:20:11 +0000 (11:20 +0100)
committerJunio C Hamano <gitster@pobox.com>
Tue, 7 Dec 2010 00:57:48 +0000 (16:57 -0800)
get_remote_merge_branch with zero or one arguments returns the
upstream branch. But a detached HEAD does no have an upstream branch,
as it is not tracking anything. Handle this case testing the exit code
of "git symbolic-ref -q HEAD".

Reported-by: Sverre Rabbelier <srabbelier@gmail.com>
Signed-off-by: Santi Béjar <santi@agolina.net>
Tested-by: Sverre Rabbelier <srabbelier@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

No differences found