diff options
author | Junio C Hamano <gitster@pobox.com> | 2010-03-02 22:55:22 -0800 |
---|---|---|
committer | Junio C Hamano <gitster@pobox.com> | 2010-03-02 22:55:22 -0800 |
commit | b46946aae74361731ab229f13f0e0a3bf1a35bb7 (patch) | |
tree | 64db9ca097142edef6a3f963f899e1620afb4128 | |
parent | be8198b236e2eeaf08618185f4f7ad83896bb704 (diff) | |
parent | b0d66e156c5b312d468344569202d8ca4094f67f (diff) | |
download | git-b46946aae74361731ab229f13f0e0a3bf1a35bb7.tar.gz git-b46946aae74361731ab229f13f0e0a3bf1a35bb7.tar.xz |
Merge branch 'tc/maint-transport-ls-remote-with-void' into maint
* tc/maint-transport-ls-remote-with-void:
transport: add got_remote_refs flag
-rw-r--r-- | transport.c | 5 | ||||
-rw-r--r-- | transport.h | 6 |
2 files changed, 10 insertions, 1 deletions
diff --git a/transport.c b/transport.c index 3846aacb4..08e4fa035 100644 --- a/transport.c +++ b/transport.c @@ -918,6 +918,7 @@ struct transport *transport_get(struct remote *remote, const char *url) if (!remote) die("No remote provided to transport_get()"); + ret->got_remote_refs = 0; ret->remote = remote; helper = remote->foreign_vcs; @@ -1079,8 +1080,10 @@ int transport_push(struct transport *transport, const struct ref *transport_get_remote_refs(struct transport *transport) { - if (!transport->remote_refs) + if (!transport->got_remote_refs) { transport->remote_refs = transport->get_refs_list(transport, 0); + transport->got_remote_refs = 1; + } return transport->remote_refs; } diff --git a/transport.h b/transport.h index 7cea5cc72..6dd9ae182 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. |