transport: add got_remote_refs flag
commitb0d66e156c5b312d468344569202d8ca4094f67f
authorTay Ray Chuan <rctay89@gmail.com>
Tue, 16 Feb 2010 07:18:21 +0000 (16 15:18 +0800)
committerJunio C Hamano <gitster@pobox.com>
Tue, 16 Feb 2010 17:11:22 +0000 (16 09:11 -0800)
treee4b403de21e001de39b390d74f695a0162ebf60d
parente923eaeb901ff056421b9007adcbbce271caa7b6
transport: add got_remote_refs flag

transport_get_remote_refs() in tranport.c checks transport->remote_refs
to determine whether transport->get_refs_list() should be invoked.  The
logic is "if it is NULL, we haven't run ls-remote to find out yet".

However, transport->remote_refs could still be NULL while cloning from
an empty repository.  This causes get_refs_list() to be run unnecessarily.

Introduce a flag, transport->got_remote_refs, to more explicitly record
if we have run transport->get_refs_list() already.

Signed-off-by: Tay Ray Chuan <rctay89@gmail.com>
Acked-by: Jeff King <peff@peff.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
transport.c
transport.h