connect: simplify SSH connection code path

The code path used in git_connect pushed the majority of the SSH
connection code into an else block, even though the if block returns.
Simplify the code by eliminating the else block, as it is unneeded.

Signed-off-by: Jeff King <peff@peff.net>
Signed-off-by: brian m. carlson <sandals@crustytoothpaste.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
This commit is contained in:
brian m. carlson
2015-04-26 20:30:10 +00:00
committed by Junio C Hamano
parent 8c2ea51254
commit 37ee646e72

View File

@ -740,7 +740,8 @@ struct child_process *git_connect(int fd[2], const char *url,
free(hostandport); free(hostandport);
free(path); free(path);
return NULL; return NULL;
} else { }
ssh = getenv("GIT_SSH_COMMAND"); ssh = getenv("GIT_SSH_COMMAND");
if (ssh) { if (ssh) {
conn->use_shell = 1; conn->use_shell = 1;
@ -761,7 +762,6 @@ struct child_process *git_connect(int fd[2], const char *url,
argv_array_push(&conn->args, port); argv_array_push(&conn->args, port);
} }
argv_array_push(&conn->args, ssh_host); argv_array_push(&conn->args, ssh_host);
}
} else { } else {
/* remove repo-local variables from the environment */ /* remove repo-local variables from the environment */
conn->env = local_repo_env; conn->env = local_repo_env;