Re: [WIP 07/15] connect: convert get_remote_heads to use struct packet_reader

2017-12-08 Thread Brandon Williams
On 12/06, Junio C Hamano wrote: > Brandon Williams writes: > > > EXPECTING_DONE sounded like we are expecting to see 'done' packet > sent from the other side, but I was mistaken. It is the state > where we are "done" expecting anything ;-). > > Having an (unconditional)

Re: [WIP 07/15] connect: convert get_remote_heads to use struct packet_reader

2017-12-06 Thread Junio C Hamano
Brandon Williams writes: > @@ -56,6 +62,41 @@ static void die_initial_contact(int unexpected) > "and the repository exists.")); > } > > +static enum protocol_version discover_version(struct packet_reader *reader) > +{ > + enum protocol_version

[WIP 07/15] connect: convert get_remote_heads to use struct packet_reader

2017-12-04 Thread Brandon Williams
In order to allow for better control flow when protocol_v2 is introduced convert 'get_remote_heads()' to use 'struct packet_reader' to read packet lines. This enables a client to be able to peek the first line of a server's response (without consuming it) in order to determine the protocol