int same_remote)
{
const char *upstream_ref;
- if (!branch)
- die(_(message_detached_head_die), remote->name);
upstream_ref = get_upstream_ref(branch, remote->name);
if (!same_remote)
die(_("You are pushing to remote '%s', which is not the upstream of\n"
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 same_remote)
{
- if (!branch)
- die(_(message_detached_head_die), remote->name);
-
if (same_remote) {
const char *upstream_ref;
break;
}
+ if (!branch)
+ die(_(message_detached_head_die), remote->name);
+
switch (push_default) {
default:
case PUSH_DEFAULT_UNSPECIFIED: