diff options
author | Junio C Hamano <gitster@pobox.com> | 2021-09-21 00:20:43 +0200 |
---|---|---|
committer | Junio C Hamano <gitster@pobox.com> | 2021-09-21 00:20:43 +0200 |
commit | 5331af2352be0d6dd57a5fc4c5dfce278cf911c7 (patch) | |
tree | 40828a511f8bfc5c31b5be61339f2d32ab6608d9 /transport.c | |
parent | Merge branch 'ar/submodule-add-more' (diff) | |
parent | upload-pack: document and rename --advertise-refs (diff) | |
download | git-5331af2352be0d6dd57a5fc4c5dfce278cf911c7.tar.xz git-5331af2352be0d6dd57a5fc4c5dfce278cf911c7.zip |
Merge branch 'ab/serve-cleanup'
Code clean-up around "git serve".
* ab/serve-cleanup:
upload-pack: document and rename --advertise-refs
serve.[ch]: remove "serve_options", split up --advertise-refs code
{upload,receive}-pack tests: add --advertise-refs tests
serve.c: move version line to advertise_capabilities()
serve: move transfer.advertiseSID check into session_id_advertise()
serve.[ch]: don't pass "struct strvec *keys" to commands
serve: use designated initializers
transport: use designated initializers
transport: rename "fetch" in transport_vtable to "fetch_refs"
serve: mark has_capability() as static
Diffstat (limited to 'transport.c')
-rw-r--r-- | transport.c | 32 |
1 files changed, 13 insertions, 19 deletions
diff --git a/transport.c b/transport.c index ab9b03ae9f..b37664ba87 100644 --- a/transport.c +++ b/transport.c @@ -887,12 +887,10 @@ static int disconnect_git(struct transport *transport) } static struct transport_vtable taken_over_vtable = { - NULL, - get_refs_via_connect, - fetch_refs_via_pack, - git_transport_push, - NULL, - disconnect_git + .get_refs_list = get_refs_via_connect, + .fetch_refs = fetch_refs_via_pack, + .push_refs = git_transport_push, + .disconnect = disconnect_git }; void transport_take_over(struct transport *transport, @@ -1036,21 +1034,17 @@ void transport_check_allowed(const char *type) } static struct transport_vtable bundle_vtable = { - NULL, - get_refs_from_bundle, - fetch_refs_from_bundle, - NULL, - NULL, - close_bundle + .get_refs_list = get_refs_from_bundle, + .fetch_refs = fetch_refs_from_bundle, + .disconnect = close_bundle }; static struct transport_vtable builtin_smart_vtable = { - NULL, - get_refs_via_connect, - fetch_refs_via_pack, - git_transport_push, - connect_git, - disconnect_git + .get_refs_list = get_refs_via_connect, + .fetch_refs = fetch_refs_via_pack, + .push_refs = git_transport_push, + .connect = connect_git, + .disconnect = disconnect_git }; struct transport *transport_get(struct remote *remote, const char *url) @@ -1457,7 +1451,7 @@ int transport_fetch_refs(struct transport *transport, struct ref *refs) heads[nr_heads++] = rm; } - rc = transport->vtable->fetch(transport, nr_heads, heads); + rc = transport->vtable->fetch_refs(transport, nr_heads, heads); free(heads); return rc; |