Thread (329 messages) 329 messages, 12 authors, 2018-03-14

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

From: Eric Sunshine <hidden>
Date: 2018-01-31 20:11:15

On Wed, Jan 31, 2018 at 10:22 AM, Derrick Stolee [off-list ref] wrote:
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
+       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
+               ret = 0;
+               goto out;
+       }
+
+       ref = alloc_ref(line_sections.items[i++].string);
and here...
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
+               const char *arg = line_sections.items[i].string;
+               if (skip_prefix(arg, "symref-target:", &arg))
+                       ref->symref = xstrdup(arg);
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help