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>
This commit is contained in:
Felipe Contreras 2021-05-31 14:51:24 -05:00 committed by Junio C Hamano
parent e0c91cffde
commit 7088ce7191

View file

@ -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: