transport: extract common fetch_pack() call
commitdde72f94bcba8f84f4ea6523b67302df6638c9c0
authorDenton Liu <liu.denton@gmail.com>
Tue, 19 May 2020 10:53:56 +0000 (19 06:53 -0400)
committerJunio C Hamano <gitster@pobox.com>
Tue, 19 May 2020 22:40:26 +0000 (19 15:40 -0700)
treedae5b8a800c72c2b56a4403566cacb6626aee11c
parent04cc91abcbeea60f0ef25c041b412480cd2b1afe
transport: extract common fetch_pack() call

In the switch statement, the difference between the `protocol_v2` and
`protocol_v{1,0}` arms is a preparatory call to die_if_server_options() in
the latter. The fetch_pack() call is identical in both arms. However,
since this fetch_pack() call has so many parameters, it is not
immediately obvious that the call is identical in both cases.

Extract the common fetch_pack() call out of the switch statement so that
code duplication is reduced and the logic is more clear for future
readers. While we're at it, rewrite the switch statement as an if-else
tower for increased clarity.

Signed-off-by: Denton Liu <liu.denton@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
transport.c