1
0
Fork 0
mirror of https://github.com/git/git.git synced 2024-06-02 12:56:31 +02:00

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>
This commit is contained in:
Felipe Contreras 2021-05-31 14:51:16 -05:00 committed by Junio C Hamano
parent cc16f95d21
commit 65c63a0054

View File

@ -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)
break;
}
branch = branch_get(NULL);
if (!branch)
die(_(message_detached_head_die), remote->name);