[PATCH 06/11] push: merge current and simple
- From
Felipe Contreras <felipe.contreras@gmail.com>
- Date
- May 28, 2021, 20:10 UTC
- Message-ID
- <20210528201014.2175179-7-felipe.contreras@gmail.com>
- In-Reply-To
- <20210528201014.2175179-1-felipe.contreras@gmail.com>
`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 --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:
-- 2.32.0.rc0