diff mbox series

[06/11] push: merge current and simple

Message ID 20210528201014.2175179-7-felipe.contreras@gmail.com (mailing list archive)
State Superseded
Headers show
Series Unconvolutize push.default=simple | expand

Commit Message

Felipe Contreras May 28, 2021, 8:10 p.m. UTC
`current` is basically the same as `simple` except always assuming we
are in a triangular workflow.

Signed-off-by: Felipe Contreras <felipe.contreras@gmail.com>
---
 builtin/push.c | 9 +--------
 1 file changed, 1 insertion(+), 8 deletions(-)
diff mbox series

Patch

diff --git a/builtin/push.c b/builtin/push.c
index 0961826269..2d6358f776 100644
--- a/builtin/push.c
+++ b/builtin/push.c
@@ -210,13 +210,6 @@  static void setup_push_upstream(struct remote *remote, struct branch *branch,
 	refspec_appendf(&rs, "%s:%s", branch->refname, branch->merge[0]->src);
 }
 
-static void setup_push_current(struct remote *remote, struct branch *branch)
-{
-	if (!branch)
-		die(_(message_detached_head_die), remote->name);
-	refspec_appendf(&rs, "%s:%s", branch->refname, branch->refname);
-}
-
 static void setup_push_simple(struct remote *remote, struct branch *branch, int triangular)
 {
 	if (!branch)
@@ -269,7 +262,7 @@  static void setup_default_push_refspecs(struct remote *remote)
 		break;
 
 	case PUSH_DEFAULT_CURRENT:
-		setup_push_current(remote, branch);
+		setup_push_simple(remote, branch, 1);
 		break;
 
 	case PUSH_DEFAULT_NOTHING: