diff mbox series

[07/11] push: remove redundant check

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

Commit Message

Felipe Contreras May 28, 2021, 8:10 p.m. UTC
If fetch_remote is NULL (i.e. the branch remote is invalid), then it
can't possibly be same as remote, which can't be NULL.

The check is redundant, and so is the extra variable.

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

Patch

diff --git a/builtin/push.c b/builtin/push.c
index 2d6358f776..f008cd624f 100644
--- a/builtin/push.c
+++ b/builtin/push.c
@@ -237,8 +237,7 @@  static void setup_push_simple(struct remote *remote, struct branch *branch, int
 
 static int is_workflow_triangular(struct remote *remote)
 {
-	struct remote *fetch_remote = remote_get(NULL);
-	return (fetch_remote && fetch_remote != remote);
+	return remote_get(NULL) != remote;
 }
 
 static void setup_default_push_refspecs(struct remote *remote)