Re: [PATCH v2 14/27] connect: request remote refs using v2

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Wed, Jan 31, 2018 at 10:22 AM, Derrick Stolee <stolee@xxxxxxxxx> wrote:
> On 1/25/2018 6:58 PM, Brandon Williams wrote:
>>  +static int process_ref_v2(const char *line, struct ref ***list)
>> +{
>> +       int ret = 1;
>> +       int i = 0;
>
> nit: you set 'i' here, but first use it in a for loop with blank
> initializer. Perhaps keep the first assignment closer to the first use?

Hmm, I see 'i' being incremented a couple times before the loop...

>> +       if (string_list_split(&line_sections, line, ' ', -1) < 2) {
>> +               ret = 0;
>> +               goto out;
>> +       }
>> +
>> +       if (get_oid_hex(line_sections.items[i++].string, &old_oid)) {

here...

>> +               ret = 0;
>> +               goto out;
>> +       }
>> +
>> +       ref = alloc_ref(line_sections.items[i++].string);

and here...

>> +
>> +       oidcpy(&ref->old_oid, &old_oid);
>> +       **list = ref;
>> +       *list = &ref->next;
>> +
>> +       for (; i < line_sections.nr; i++) {

then it is used in the loop.

>> +               const char *arg = line_sections.items[i].string;
>> +               if (skip_prefix(arg, "symref-target:", &arg))
>> +                       ref->symref = xstrdup(arg);



[Index of Archives]     [Linux Kernel Development]     [Gcc Help]     [IETF Annouce]     [DCCP]     [Netdev]     [Networking]     [Security]     [V4L]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux SCSI]     [Fedora Users]

  Powered by Linux