| 2026 | } |
| 2027 | |
| 2028 | static int remove_duplicates_in_refs(struct ref **ref, int nr) |
| 2029 | { |
| 2030 | struct string_list names = STRING_LIST_INIT_NODUP; |
| 2031 | int src, dst; |
| 2032 | |
| 2033 | for (src = dst = 0; src < nr; src++) { |
| 2034 | struct string_list_item *item; |
| 2035 | item = string_list_insert(&names, ref[src]->name); |
| 2036 | if (item->util) |
| 2037 | continue; /* already have it */ |
| 2038 | item->util = ref[src]; |
| 2039 | if (src != dst) |
| 2040 | ref[dst] = ref[src]; |
| 2041 | dst++; |
| 2042 | } |
| 2043 | for (src = dst; src < nr; src++) |
| 2044 | ref[src] = NULL; |
| 2045 | string_list_clear(&names, 0); |
| 2046 | return dst; |
| 2047 | } |
| 2048 | |
| 2049 | static void update_shallow(struct fetch_pack_args *args, |
| 2050 | struct ref **sought, int nr_sought, |
no test coverage detected