Thread (22 messages) flat view 22 messages, 1 author, 2021-05-31
STALE1941d

[PATCH v2 13/13] push: don't get a full remote object

From: Felipe Contreras <hidden>
Date: 2021-05-31 19:52:17
Subsystem: the rest · Maintainer: Linus Torvalds

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 <redacted>
---
 builtin/push.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
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:
-- 
2.32.0.rc0
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help