aboutsummaryrefslogtreecommitdiff
path: root/builtin/index-pack.c
diff options
context:
space:
mode:
authorJonathan Nieder <jrnieder@gmail.com>2017-11-20 13:22:54 -0800
committerJunio C Hamano <gitster@pobox.com>2017-11-21 14:01:02 +0900
commit8e349780ecb9bcec52c7df22fcbfb4afd0d7936c (patch)
tree5fb040204fb6d89cd332a8fdc77231f98f8db9b2 /builtin/index-pack.c
parent8339805b467ca5b2d9314fdbfdd75a6e96c6b39a (diff)
downloadgit-8e349780ecb9bcec52c7df22fcbfb4afd0d7936c.tar.gz
git-8e349780ecb9bcec52c7df22fcbfb4afd0d7936c.tar.xz
connect: move no_fork fallback to git_tcp_connect
git_connect has the structure struct child_process *conn = &no_fork; ... switch (protocol) { case PROTO_GIT: if (git_use_proxy(hostandport)) conn = git_proxy_connect(fd, hostandport); else git_tcp_connect(fd, hostandport, flags); ... break; case PROTO_SSH: conn = xmalloc(sizeof(*conn)); child_process_init(conn); argv_array_push(&conn->args, ssh); ... break; ... return conn; In all cases except the git_tcp_connect case, conn is explicitly assigned a value. Make the code clearer by explicitly assigning 'conn = &no_fork' in the tcp case and eliminating the default so the compiler can ensure conn is always correctly assigned. Noticed-by: Junio C Hamano <gitster@pobox.com> Signed-off-by: Jonathan Nieder <jrnieder@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 'builtin/index-pack.c')
0 files changed, 0 insertions, 0 deletions