return ref;
}
-static int remove_duplicates(struct string_list *sought)
-{
- int src, dst;
-
- if (!sought->nr)
- return 0;
-
- for (src = dst = 1; src < sought->nr; src++)
- if (strcmp(sought->items[src].string, sought->items[dst-1].string))
- sought->items[dst++] = sought->items[src];
- return dst;
-}
-
static int fetch_pack_config(const char *var, const char *value, void *cb)
{
if (strcmp(var, "fetch.unpacklimit") == 0) {
if (sought->nr) {
sort_string_list(sought);
- remove_duplicates(sought);
+ string_list_remove_duplicates(sought, 0);
}
if (!ref) {
test_expect_success 'test duplicate refs from stdin' '
(
cd client &&
- test_must_fail git fetch-pack --stdin --no-progress .. <../input.dup
+ git fetch-pack --stdin --no-progress .. <../input.dup
) >output &&
cut -d " " -f 2 <output | sort >actual &&
test_cmp expect actual