Merge branch 'md/list-objects-filter-memfix'
authorJunio C Hamano <gitster@pobox.com>
Fri, 21 Jun 2019 18:24:09 +0000 (11:24 -0700)
committerJunio C Hamano <gitster@pobox.com>
Fri, 21 Jun 2019 18:24:09 +0000 (11:24 -0700)
The filter_data used in the list-objects-filter (which manages a
lazily sparse clone repository) did not use the dynamic array API
correctly---'nr' is supposed to point at one past the last element
of the array in use. This has been corrected.

* md/list-objects-filter-memfix:
list-objects-filter: correct usage of ALLOC_GROW

1  2 
list-objects-filter.c
index 53f90442c5da992808f09f6d764fcefc44d70ee0,7824a480e18faad51b6c7161061f25c71c262b71..36e1f774bcfc50d0475ad835464cec092314eb79
@@@ -354,9 -268,9 +354,9 @@@ static enum list_objects_filter_result 
                dtype = DT_DIR;
                val = is_excluded_from_list(pathname, strlen(pathname),
                                            filename, &dtype, &filter_data->el,
 -                                          &the_index);
 +                                          r->index);
                if (val < 0)
-                       val = filter_data->array_frame[filter_data->nr].defval;
+                       val = filter_data->array_frame[filter_data->nr - 1].defval;
  
                ALLOC_GROW(filter_data->array_frame, filter_data->nr + 1,
                           filter_data->alloc);