Git/Packet: clarify that packet_required_key_val_read allows EOF

The function calls itself "required", but it does not die when it
sees an unexpected EOF.

Let's rename it to "packet_key_val_read()".

Signed-off-by: Christian Couder <chriscool@tuxfamily.org>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
This commit is contained in:
Christian Couder
2017-11-21 17:09:38 +01:00
committed by Junio C Hamano
parent 0fe8d516bb
commit cb1c64b4a8
2 changed files with 9 additions and 4 deletions

View File

@ -70,7 +70,7 @@ print $debug "init handshake complete\n";
$debug->flush();
while (1) {
my ( $res, $command ) = packet_required_key_val_read("command");
my ( $res, $command ) = packet_key_val_read("command");
if ( $res == -1 ) {
print $debug "STOP\n";
exit();
@ -106,7 +106,7 @@ while (1) {
packet_txt_write("status=success");
packet_flush();
} else {
my ( $res, $pathname ) = packet_required_key_val_read("pathname");
my ( $res, $pathname ) = packet_key_val_read("pathname");
if ( $res == -1 ) {
die "unexpected EOF while expecting pathname";
}