diff mbox series

[11/15] push: fix Yoda condition

Message ID 20210529074458.1916817-12-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
We want to check if remote is the same as the branch remote, not the
other way around.

Signed-off-by: Felipe Contreras <felipe.contreras@gmail.com>
---
 builtin/push.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Comments

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

> We want to check if remote is the same as the branch remote, not the
> other way around.
>
> Signed-off-by: Felipe Contreras <felipe.contreras@gmail.com>
> ---
>  builtin/push.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)

This is 10/15's making, and squashing them together will make both
the entire series (because doing so means that the reviewers need to
see one fewer step) and 10/15 (because the end result of the conversion
is more "logical") easier to review (and later read in "git log -p").

>
> diff --git a/builtin/push.c b/builtin/push.c
> index 7485522807..468ccc1067 100644
> --- a/builtin/push.c
> +++ b/builtin/push.c
> @@ -204,7 +204,7 @@ static const char *get_upstream_ref(struct branch *branch, const char *remote_na
>  
>  static int is_workflow_triangular(struct remote *remote)
>  {
> -	return remote_get(NULL) != remote;
> +	return remote != remote_get(NULL);
>  }
>  
>  static void setup_default_push_refspecs(struct remote *remote)
diff mbox series

Patch

diff --git a/builtin/push.c b/builtin/push.c
index 7485522807..468ccc1067 100644
--- a/builtin/push.c
+++ b/builtin/push.c
@@ -204,7 +204,7 @@  static const char *get_upstream_ref(struct branch *branch, const char *remote_na
 
 static int is_workflow_triangular(struct remote *remote)
 {
-	return remote_get(NULL) != remote;
+	return remote != remote_get(NULL);
 }
 
 static void setup_default_push_refspecs(struct remote *remote)