Browse Source

push: only get the branch when needed

Signed-off-by: Felipe Contreras <felipe.contreras@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
maint
Felipe Contreras 4 years ago committed by Junio C Hamano
parent
commit
65c63a0054
  1. 3
      builtin/push.c

3
builtin/push.c

@ -243,7 +243,7 @@ static int is_same_remote(struct remote *remote) @@ -243,7 +243,7 @@ static int is_same_remote(struct remote *remote)

static void setup_default_push_refspecs(struct remote *remote)
{
struct branch *branch = branch_get(NULL);
struct branch *branch;
int same_remote = is_same_remote(remote);

switch (push_default) {
@ -259,6 +259,7 @@ static void setup_default_push_refspecs(struct remote *remote) @@ -259,6 +259,7 @@ static void setup_default_push_refspecs(struct remote *remote)
break;
}

branch = branch_get(NULL);
if (!branch)
die(_(message_detached_head_die), remote->name);


Loading…
Cancel
Save