]> git.ipfire.org Git - thirdparty/git.git/commitdiff
push: remove unused code in setup_push_upstream()
authorFelipe Contreras <felipe.contreras@gmail.com>
Mon, 31 May 2021 19:32:36 +0000 (14:32 -0500)
committerJunio C Hamano <gitster@pobox.com>
Wed, 2 Jun 2021 01:09:52 +0000 (10:09 +0900)
Now it's not used for the simple mode.

Signed-off-by: Felipe Contreras <felipe.contreras@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
builtin/push.c

index e37c7512682ee30dcd4eecb8bd1f6ccea3d5a437..29fea70ff1715e0183bb189257bd7e8f632fb8f6 100644 (file)
@@ -186,7 +186,7 @@ static const char message_detached_head_die[] =
           "    git push %s HEAD:<name-of-remote-branch>\n");
 
 static void setup_push_upstream(struct remote *remote, struct branch *branch,
-                               int same_remote, int simple)
+                               int same_remote)
 {
        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, same_remote, 0);
+               setup_push_upstream(remote, branch, same_remote);
                break;
 
        case PUSH_DEFAULT_CURRENT: