diff options
-rw-r--r-- | builtin/fetch-pack.c | 15 | ||||
-rwxr-xr-x | t/t5500-fetch-pack.sh | 2 |
2 files changed, 2 insertions, 15 deletions
diff --git a/builtin/fetch-pack.c b/builtin/fetch-pack.c index 63d455ffef..6cd734a9cb 100644 --- a/builtin/fetch-pack.c +++ b/builtin/fetch-pack.c @@ -858,19 +858,6 @@ static struct ref *do_fetch_pack(int fd[2], 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) { @@ -1090,7 +1077,7 @@ struct ref *fetch_pack(struct fetch_pack_args *my_args, if (sought->nr) { sort_string_list(sought); - remove_duplicates(sought); + string_list_remove_duplicates(sought, 0); } if (!ref) { diff --git a/t/t5500-fetch-pack.sh b/t/t5500-fetch-pack.sh index 15d277f158..acd41e8576 100755 --- a/t/t5500-fetch-pack.sh +++ b/t/t5500-fetch-pack.sh @@ -391,7 +391,7 @@ test_expect_success 'fetch mixed refs from cmdline and stdin' ' 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 |