Skip to content

Commit 7e6d72b

Browse files
felipecgitster
authored andcommitted
push: remove unused code in setup_push_upstream()
Now it's not used for the simple mode. Signed-off-by: Felipe Contreras <[email protected]> Signed-off-by: Junio C Hamano <[email protected]>
1 parent b8e8b98 commit 7e6d72b

File tree

1 file changed

+2
-8
lines changed

1 file changed

+2
-8
lines changed

builtin/push.c

Lines changed: 2 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -186,7 +186,7 @@ static const char message_detached_head_die[] =
186186
" git push %s HEAD:<name-of-remote-branch>\n");
187187

188188
static void setup_push_upstream(struct remote *remote, struct branch *branch,
189-
int same_remote, int simple)
189+
int same_remote)
190190
{
191191
if (!branch)
192192
die(_(message_detached_head_die), remote->name);
@@ -207,12 +207,6 @@ static void setup_push_upstream(struct remote *remote, struct branch *branch,
207207
"to update which remote branch."),
208208
remote->name, branch->name);
209209

210-
if (simple) {
211-
/* Additional safety */
212-
if (strcmp(branch->refname, branch->merge[0]->src))
213-
die_push_simple(branch, remote);
214-
}
215-
216210
refspec_appendf(&rs, "%s:%s", branch->refname, branch->merge[0]->src);
217211
}
218212

@@ -271,7 +265,7 @@ static void setup_default_push_refspecs(struct remote *remote)
271265
break;
272266

273267
case PUSH_DEFAULT_UPSTREAM:
274-
setup_push_upstream(remote, branch, same_remote, 0);
268+
setup_push_upstream(remote, branch, same_remote);
275269
break;
276270

277271
case PUSH_DEFAULT_CURRENT:

0 commit comments

Comments
 (0)