From: Felipe Contreras Date: Fri, 28 May 2021 20:10:08 GMT Subject: [PATCH 05/11] push: remove unused code in setup_push_upstream() Message-ID: <20210528201014.2175179-6-felipe.contreras@gmail.com> In-Reply-To: <20210528201014.2175179-1-felipe.contreras@gmail.com> Now it's not used for the simple mode. Signed-off-by: Felipe Contreras --- builtin/push.c | 10 ++-------- 1 file changed, 2 insertions(+), 8 deletions(-) diff --git a/builtin/push.c b/builtin/push.c index 73fe083682..0961826269 100644 --- a/builtin/push.c +++ b/builtin/push.c @@ -186,7 +186,7 @@ static const char message_detached_head_die[] = " git push %s HEAD:\n"); static void setup_push_upstream(struct remote *remote, struct branch *branch, - int triangular, int simple) + int triangular) { if (!branch) die(_(message_detached_head_die), remote->name); @@ -207,12 +207,6 @@ static void setup_push_upstream(struct remote *remote, struct branch *branch, "to update which remote branch."), remote->name, branch->name); - if (simple) { - /* Additional safety */ - if (strcmp(branch->refname, branch->merge[0]->src)) - die_push_simple(branch, remote); - } - refspec_appendf(&rs, "%s:%s", branch->refname, branch->merge[0]->src); } @@ -271,7 +265,7 @@ static void setup_default_push_refspecs(struct remote *remote) break; case PUSH_DEFAULT_UPSTREAM: - setup_push_upstream(remote, branch, triangular, 0); + setup_push_upstream(remote, branch, triangular); break; case PUSH_DEFAULT_CURRENT: -- 2.32.0.rc0