From: Jeff King Date: Thu, 24 May 2012 06:04:51 +0000 (-0400) Subject: fetch-pack: sort incoming heads list earlier X-Git-Tag: v1.7.11-rc1~16^2 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=3d2a33e57faa84be3ab83a80c8b75dad3e747054;p=thirdparty%2Fgit.git fetch-pack: sort incoming heads list earlier Commit 4435968 started sorting heads fed to fetch-pack so that later commits could use more optimized algorithms; commit 7db8d53 switched the remove_duplicates function to such an algorithm. Of course, the sorting is more effective if you do it _before_ the algorithm in question. Signed-off-by: Jeff King Signed-off-by: Junio C Hamano --- diff --git a/builtin/fetch-pack.c b/builtin/fetch-pack.c index 8a724739ba..b18ba05bbe 100644 --- a/builtin/fetch-pack.c +++ b/builtin/fetch-pack.c @@ -1082,8 +1082,8 @@ struct ref *fetch_pack(struct fetch_pack_args *my_args, } if (heads && nr_heads) { - nr_heads = remove_duplicates(nr_heads, heads); qsort(heads, nr_heads, sizeof(*heads), compare_heads); + nr_heads = remove_duplicates(nr_heads, heads); } if (!ref) {