Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.kernel.org/pub/scm/git/git.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorFelipe Contreras <felipe.contreras@gmail.com>2021-05-31 22:51:16 +0300
committerJunio C Hamano <gitster@pobox.com>2021-06-02 04:12:01 +0300
commit65c63a005434306e7c064eb463ff1f61de56d38e (patch)
treeccbba2583657a1bc973915dbeeead30883f1a340 /builtin/push.c
parentcc16f95d212d8e0bba07ddfb82aaf416dc4df1c2 (diff)
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>
Diffstat (limited to 'builtin/push.c')
-rw-r--r--builtin/push.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/builtin/push.c b/builtin/push.c
index 8fcbd2878d..d9f9d20f39 100644
--- a/builtin/push.c
+++ b/builtin/push.c
@@ -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);