diff options
author | Tay Ray Chuan <rctay89@gmail.com> | 2010-02-16 08:18:21 +0100 |
---|---|---|
committer | Junio C Hamano <gitster@pobox.com> | 2010-02-16 18:11:22 +0100 |
commit | b0d66e156c5b312d468344569202d8ca4094f67f (patch) | |
tree | e4b403de21e001de39b390d74f695a0162ebf60d /transport.h | |
parent | Git 1.7.0 (diff) | |
download | git-b0d66e156c5b312d468344569202d8ca4094f67f.tar.xz git-b0d66e156c5b312d468344569202d8ca4094f67f.zip |
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>
Diffstat (limited to 'transport.h')
-rw-r--r-- | transport.h | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/transport.h b/transport.h index 7cea5cc723..6dd9ae182f 100644 --- a/transport.h +++ b/transport.h @@ -20,6 +20,12 @@ struct transport { const struct ref *remote_refs; /** + * Indicates whether we already called get_refs_list(); set by + * transport.c::transport_get_remote_refs(). + */ + unsigned got_remote_refs : 1; + + /** * Returns 0 if successful, positive if the option is not * recognized or is inapplicable, and negative if the option * is applicable but the value is invalid. |