summaryrefslogtreecommitdiff
path: root/builtin
diff options
context:
space:
mode:
authorLibravatar Felipe Contreras <felipe.contreras@gmail.com>2021-05-31 14:51:24 -0500
committerLibravatar Junio C Hamano <gitster@pobox.com>2021-06-02 10:12:03 +0900
commit7088ce71918a0f9fde2ceb421d4b332888a202c7 (patch)
tree0f492edd53efce82103f5220234c6a06abee119c /builtin
parentpush: only check same_remote when needed (diff)
downloadtgif-7088ce71918a0f9fde2ceb421d4b332888a202c7.tar.xz
push: don't get a full remote object
All we need to know is that their names are the same. Additionally this might be easier to parse for some since remote_for_branch is more descriptive than remote_get(NULL). Signed-off-by: Felipe Contreras <felipe.contreras@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 'builtin')
-rw-r--r--builtin/push.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/builtin/push.c b/builtin/push.c
index f3916c66d1..e8b10a9b7e 100644
--- a/builtin/push.c
+++ b/builtin/push.c
@@ -226,7 +226,7 @@ static void setup_default_push_refspecs(struct remote *remote)
die(_(message_detached_head_die), remote->name);
dst = branch->refname;
- same_remote = remote == remote_get(NULL);
+ same_remote = !strcmp(remote->name, remote_for_branch(branch, NULL));
switch (push_default) {
default: