{"thread":{"id":"47435","subject":"[PATCH] transport: remove unused \"push\" in vtable","startedAt":"2017-12-12T23:11:08Z","lastAt":"2017-12-13T00:49:22Z","messageCount":2,"participants":["Jonathan Tan","Jeff King"],"isPatch":true,"patchVersion":1,"patchTotal":null},"messages":[{"id":"334723","messageId":"20171212231056.256585-1-jonathantanmy@google.com","threadId":"47435","inReplyTo":null,"subject":"[PATCH] transport: remove unused \"push\" in vtable","fromName":"Jonathan Tan","fromEmail":"jonathantanmy@google.com","sentAt":"2017-12-12T23:10:56Z","receivedAt":"2017-12-12T23:11:08Z","isPatch":true,"sender":{"key":"jonathantanmy@fastmail.com","avatar":null},"body":"After commit 0d0bac67ce3b (\"transport: drop support for git-over-rsync\",\n2016-02-01), no transport in Git populates the \"push\" entry in the\ntransport vtable. Remove this entry.\n\nSigned-off-by: Jonathan Tan <jonathantanmy@google.com>\n---\nI was taking a look at the transport code and noticed that push is\nunused (and push_refs is used instead). Here is a code cleanup.\n---\n transport.c | 9 +--------\n transport.h | 1 -\n 2 files changed, 1 insertion(+), 9 deletions(-)\n\ndiff --git a/transport.c b/transport.c\nindex 7231d1b1b..7cc39b7c0 100644\n--- a/transport.c\n+++ b/transport.c\n@@ -627,7 +627,6 @@ void transport_take_over(struct transport *transport,\n \ttransport->set_option = NULL;\n \ttransport->get_refs_list = get_refs_via_connect;\n \ttransport->fetch = fetch_refs_via_pack;\n-\ttransport->push = NULL;\n \ttransport->push_refs = git_transport_push;\n \ttransport->disconnect = disconnect_git;\n \ttransport->smart_options = &(data->options);\n@@ -969,13 +968,7 @@ int transport_push(struct transport *transport,\n \t*reject_reasons = 0;\n \ttransport_verify_remote_names(refspec_nr, refspec);\n \n-\tif (transport->push) {\n-\t\t/* Maybe FIXME. But no important transport uses this case. */\n-\t\tif (flags & TRANSPORT_PUSH_SET_UPSTREAM)\n-\t\t\tdie(\"This transport does not support using --set-upstream\");\n-\n-\t\treturn transport->push(transport, refspec_nr, refspec, flags);\n-\t} else if (transport->push_refs) {\n+\tif (transport->push_refs) {\n \t\tstruct ref *remote_refs;\n \t\tstruct ref *local_refs = get_local_heads();\n \t\tint match_flags = MATCH_REFS_NONE;\ndiff --git a/transport.h b/transport.h\nindex bc5571574..ab4fe7f27 100644\n--- a/transport.h\n+++ b/transport.h\n@@ -103,7 +103,6 @@ struct transport {\n \t * process involved generating new commits.\n \t **/\n \tint (*push_refs)(struct transport *transport, struct ref *refs, int flags);\n-\tint (*push)(struct transport *connection, int refspec_nr, const char **refspec, int flags);\n \tint (*connect)(struct transport *connection, const char *name,\n \t\t       const char *executable, int fd[2]);\n \n-- \n2.15.1.424.g9478a66081-goog\n\n"},{"id":"334731","messageId":"20171213004907.GA10984@sigill.intra.peff.net","threadId":"47435","inReplyTo":"20171212231056.256585-1-jonathantanmy@google.com","subject":"Re: [PATCH] transport: remove unused \"push\" in vtable","fromName":"Jeff King","fromEmail":"peff@peff.net","sentAt":"2017-12-13T00:49:07Z","receivedAt":"2017-12-13T00:49:22Z","isPatch":true,"sender":{"key":"peff@peff.net","avatar":"https://avatars.githubusercontent.com/u/45925?v=4"},"body":"On Tue, Dec 12, 2017 at 03:10:56PM -0800, Jonathan Tan wrote:\n\n> After commit 0d0bac67ce3b (\"transport: drop support for git-over-rsync\",\n> 2016-02-01), no transport in Git populates the \"push\" entry in the\n> transport vtable. Remove this entry.\n\nYay. Thanks for cleaning this up.\n\n-Peff\n"}]}