Re: [PATCH 13/26] connect: request remote refs using v2
- From
- Jonathan Tan <jonathantanmy@google.com>
- Date
- Jan 9, 2018, 22:24 UTC
- Message-ID
- <20180109142451.1e10f3936eafc270c9bb8b76@google.com>
- In-Reply-To
- <20180103001828.205012-14-bmwill@google.com>
On Tue, 2 Jan 2018 16:18:15 -0800 Brandon Williams <bmwill@google.com> wrote:
Show 21 quoted lines
> diff --git a/connect.c b/connect.c > index caa539b75..9badd403f 100644 > --- a/connect.c > +++ b/connect.c > @@ -12,9 +12,11 @@ > #include "sha1-array.h" > #include "transport.h" > #include "strbuf.h" > +#include "version.h" > #include "protocol.h" > > static char *server_capabilities; > +static struct argv_array server_capabilities_v2 = ARGV_ARRAY_INIT; > static const char *parse_feature_value(const char *, const char *, int *); > > static int check_ref(const char *name, unsigned int flags) > @@ -62,6 +64,33 @@ static void die_initial_contact(int unexpected) > "and the repository exists.")); > } > > +static int server_supports_v2(const char *c, int die_on_error)
Document what "c" means.
[snip]
Show 5 quoted lines
> +static void process_capabilities_v2(struct packet_reader *reader)
> +{
> + while (packet_reader_read(reader) == PACKET_READ_NORMAL) {
> + argv_array_push(&server_capabilities_v2, reader->line);
> + }No need for braces on single-line blocks.
> +static int process_ref_v2(const char *line, struct ref ***list)
The "list" is the tail of a linked list, so maybe name it "tail" instead.