receive-pack: use default version 0 for proc-receive
In the verison negotiation phase between "receive-pack" and "proc-receive", "proc-receive" can send an empty flush-pkt to end the negotiation and use default version 0. Capabilities (such as "push-options") are not supported in version 0. Signed-off-by: Jiang Xin <zhiyou.jx@alibaba-inc.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
This commit is contained in:

committed by
Junio C Hamano

parent
f65003b4c4
commit
80ffeb94f4
@ -1192,7 +1192,12 @@ static int run_proc_receive_hook(struct command *commands,
|
||||
goto cleanup;
|
||||
}
|
||||
|
||||
if (version != 1) {
|
||||
switch (version) {
|
||||
case 0:
|
||||
/* fallthrough */
|
||||
case 1:
|
||||
break;
|
||||
default:
|
||||
strbuf_addf(&errmsg, "proc-receive version '%d' is not supported",
|
||||
version);
|
||||
code = -1;
|
||||
|
Reference in New Issue
Block a user