Re: [PATCH v2 14/27] connect: request remote refs using v2
From: Derrick Stolee <hidden>
Date: 2018-01-31 22:14:44
On 1/31/2018 3:10 PM, Eric Sunshine wrote:
On Wed, Jan 31, 2018 at 10:22 AM, Derrick Stolee [off-list ref] wrote:quoted
On 1/25/2018 6:58 PM, Brandon Williams wrote:quoted
+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...quoted
quoted
+ 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...quoted
quoted
+ ret = 0; + goto out; + } + + ref = alloc_ref(line_sections.items[i++].string);and here...quoted
quoted
+ + oidcpy(&ref->old_oid, &old_oid); + **list = ref; + *list = &ref->next; + + for (; i < line_sections.nr; i++) {then it is used in the loop.quoted
quoted
+ const char *arg = line_sections.items[i].string; + if (skip_prefix(arg, "symref-target:", &arg)) + ref->symref = xstrdup(arg);
Thanks! Sorry I missed this. -Stolee