diff mbox series

[13/15] push: only get triangular when needed

Message ID 20210529074458.1916817-14-felipe.contreras@gmail.com (mailing list archive)
State Superseded
Headers show
Series Unconvolutize push.default=simple | expand

Commit Message

Felipe Contreras May 29, 2021, 7:44 a.m. UTC
Signed-off-by: Felipe Contreras <felipe.contreras@gmail.com>
---
 builtin/push.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

Comments

Junio C Hamano May 31, 2021, 6:48 a.m. UTC | #1
Felipe Contreras <felipe.contreras@gmail.com> writes:

> Signed-off-by: Felipe Contreras <felipe.contreras@gmail.com>
> ---
>  builtin/push.c | 3 ++-
>  1 file changed, 2 insertions(+), 1 deletion(-)
>
> diff --git a/builtin/push.c b/builtin/push.c
> index c220f70795..818ca4c5c9 100644
> --- a/builtin/push.c
> +++ b/builtin/push.c
> @@ -205,8 +205,8 @@ static const char *get_upstream_ref(struct branch *branch, const char *remote_na
>  static void setup_default_push_refspecs(struct remote *remote)
>  {
>  	struct branch *branch;
> -	int triangular = remote != remote_get(NULL);
>  	const char *dst;
> +	int triangular;
>  
>  	switch (push_default) {
>  	case PUSH_DEFAULT_MATCHING:
> @@ -225,6 +225,7 @@ static void setup_default_push_refspecs(struct remote *remote)
>  		die(_(message_detached_head_die), remote->name);
>  
>  	dst = branch->refname;
> +	triangular = remote != remote_get(NULL);
>  
>  	switch (push_default) {
>  	default:

This is another change that got helped by an earlier split.
Good.
diff mbox series

Patch

diff --git a/builtin/push.c b/builtin/push.c
index c220f70795..818ca4c5c9 100644
--- a/builtin/push.c
+++ b/builtin/push.c
@@ -205,8 +205,8 @@  static const char *get_upstream_ref(struct branch *branch, const char *remote_na
 static void setup_default_push_refspecs(struct remote *remote)
 {
 	struct branch *branch;
-	int triangular = remote != remote_get(NULL);
 	const char *dst;
+	int triangular;
 
 	switch (push_default) {
 	case PUSH_DEFAULT_MATCHING:
@@ -225,6 +225,7 @@  static void setup_default_push_refspecs(struct remote *remote)
 		die(_(message_detached_head_die), remote->name);
 
 	dst = branch->refname;
+	triangular = remote != remote_get(NULL);
 
 	switch (push_default) {
 	default: