Merge branch 'tc/maint-transport-ls-remote-with-void'
* tc/maint-transport-ls-remote-with-void: transport: add got_remote_refs flag
This commit is contained in:
commit
cab1b013e6
@ -918,6 +918,7 @@ struct transport *transport_get(struct remote *remote, const char *url)
|
|||||||
if (!remote)
|
if (!remote)
|
||||||
die("No remote provided to transport_get()");
|
die("No remote provided to transport_get()");
|
||||||
|
|
||||||
|
ret->got_remote_refs = 0;
|
||||||
ret->remote = remote;
|
ret->remote = remote;
|
||||||
helper = remote->foreign_vcs;
|
helper = remote->foreign_vcs;
|
||||||
|
|
||||||
@ -1079,8 +1080,10 @@ int transport_push(struct transport *transport,
|
|||||||
|
|
||||||
const struct ref *transport_get_remote_refs(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->remote_refs = transport->get_refs_list(transport, 0);
|
||||||
|
transport->got_remote_refs = 1;
|
||||||
|
}
|
||||||
|
|
||||||
return transport->remote_refs;
|
return transport->remote_refs;
|
||||||
}
|
}
|
||||||
|
@ -19,6 +19,12 @@ struct transport {
|
|||||||
void *data;
|
void *data;
|
||||||
const struct ref *remote_refs;
|
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
|
* Returns 0 if successful, positive if the option is not
|
||||||
* recognized or is inapplicable, and negative if the option
|
* recognized or is inapplicable, and negative if the option
|
||||||
|
Loading…
Reference in New Issue
Block a user