git@vger.kernel.org mailing list mirror (one of many)
 help / color / mirror / code / Atom feed
* [PATCH] transport: remove unused "push" in vtable
@ 2017-12-12 23:10 Jonathan Tan
  2017-12-13  0:49 ` Jeff King
  0 siblings, 1 reply; 2+ messages in thread
From: Jonathan Tan @ 2017-12-12 23:10 UTC (permalink / raw)
  To: git; +Cc: Jonathan Tan, peff

After commit 0d0bac67ce3b ("transport: drop support for git-over-rsync",
2016-02-01), no transport in Git populates the "push" entry in the
transport vtable. Remove this entry.

Signed-off-by: Jonathan Tan <jonathantanmy@google.com>
---
I was taking a look at the transport code and noticed that push is
unused (and push_refs is used instead). Here is a code cleanup.
---
 transport.c | 9 +--------
 transport.h | 1 -
 2 files changed, 1 insertion(+), 9 deletions(-)

diff --git a/transport.c b/transport.c
index 7231d1b1b..7cc39b7c0 100644
--- a/transport.c
+++ b/transport.c
@@ -627,7 +627,6 @@ void transport_take_over(struct transport *transport,
 	transport->set_option = NULL;
 	transport->get_refs_list = get_refs_via_connect;
 	transport->fetch = fetch_refs_via_pack;
-	transport->push = NULL;
 	transport->push_refs = git_transport_push;
 	transport->disconnect = disconnect_git;
 	transport->smart_options = &(data->options);
@@ -969,13 +968,7 @@ int transport_push(struct transport *transport,
 	*reject_reasons = 0;
 	transport_verify_remote_names(refspec_nr, refspec);
 
-	if (transport->push) {
-		/* Maybe FIXME. But no important transport uses this case. */
-		if (flags & TRANSPORT_PUSH_SET_UPSTREAM)
-			die("This transport does not support using --set-upstream");
-
-		return transport->push(transport, refspec_nr, refspec, flags);
-	} else if (transport->push_refs) {
+	if (transport->push_refs) {
 		struct ref *remote_refs;
 		struct ref *local_refs = get_local_heads();
 		int match_flags = MATCH_REFS_NONE;
diff --git a/transport.h b/transport.h
index bc5571574..ab4fe7f27 100644
--- a/transport.h
+++ b/transport.h
@@ -103,7 +103,6 @@ struct transport {
 	 * process involved generating new commits.
 	 **/
 	int (*push_refs)(struct transport *transport, struct ref *refs, int flags);
-	int (*push)(struct transport *connection, int refspec_nr, const char **refspec, int flags);
 	int (*connect)(struct transport *connection, const char *name,
 		       const char *executable, int fd[2]);
 
-- 
2.15.1.424.g9478a66081-goog


^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [PATCH] transport: remove unused "push" in vtable
  2017-12-12 23:10 [PATCH] transport: remove unused "push" in vtable Jonathan Tan
@ 2017-12-13  0:49 ` Jeff King
  0 siblings, 0 replies; 2+ messages in thread
From: Jeff King @ 2017-12-13  0:49 UTC (permalink / raw)
  To: Jonathan Tan; +Cc: git

On Tue, Dec 12, 2017 at 03:10:56PM -0800, Jonathan Tan wrote:

> After commit 0d0bac67ce3b ("transport: drop support for git-over-rsync",
> 2016-02-01), no transport in Git populates the "push" entry in the
> transport vtable. Remove this entry.

Yay. Thanks for cleaning this up.

-Peff

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2017-12-13  0:49 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-12-12 23:10 [PATCH] transport: remove unused "push" in vtable Jonathan Tan
2017-12-13  0:49 ` Jeff King

Code repositories for project(s) associated with this public inbox

	https://80x24.org/mirrors/git.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).