Re: [PATCH 10/14] is_dup_ref(): extract function from sort_ref_list()
mhagger@alum.mit.edu writes:
Show 7 quoted lines
> ...
> @@ -94,15 +113,11 @@ static void sort_ref_array(struct ref_array *array)
>
> qsort(array->refs, array->nr, sizeof(*array->refs), ref_entry_cmp);
>
> - /* Remove any duplicates from the ref_array */
> + /* Remove any duplicates from the ref_list */
Eh... Also needs retitled.
Show 12 quoted lines
> for (; j < array->nr; j++) {
> struct ref_entry *a = array->refs[i];
> struct ref_entry *b = array->refs[j];
> - if (!strcmp(a->name, b->name)) {
> - if (hashcmp(a->sha1, b->sha1))
> - die("Duplicated ref, and SHA1s don't match: %s",
> - a->name);
> - warning("Duplicated ref: %s", a->name);
> + if (is_dup_ref(a, b)) {
> free(b);
> continue;
> }