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.
Also, fix the Yoda condition: 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>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
static int is_same_remote(struct remote *remote)
{
- struct remote *fetch_remote = remote_get(NULL);
- return (!fetch_remote || fetch_remote == remote);
+ return remote == remote_get(NULL);
}
static void setup_default_push_refspecs(struct remote *remote)