Re: [PATCH v3 01/10] connect: in ref advertisement, shallows are last
- From
- Jonathan Tan <jonathantanmy@google.com>
- Date
- Oct 10, 2017, 18:14 UTC
- Message-ID
- <20171010111453.21d858dc38d8bfe6590c3579@google.com>
- In-Reply-To
- <20171003201507.3589-2-bmwill@google.com>
On Tue, 3 Oct 2017 13:14:58 -0700 Brandon Williams <bmwill@google.com> wrote:
Show 13 quoted lines
> +static int process_dummy_ref(void)
> +{
> + struct object_id oid;
> + const char *name;
> +
> + if (parse_oid_hex(packet_buffer, &oid, &name))
> + return 0;
> + if (*name != ' ')
> + return 0;
> + name++;
> +
> + return !oidcmp(&null_oid, &oid) && !strcmp(name, "capabilities^{}");
> +}Nit: If you're planning to parse_oid_hex, you can strcmp with
" capabilities^{}" directly (note the space at the start) instead of
first checking for ' ' then "capabilities^{}".