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 <peff@peff.net> Signed-off-by: Junio C Hamano <gitster@pobox.com>

Jeff King committed May 24, 2012 at 02:04 UTC 3d2a33e57faa84be3ab83a80c8b75dad3e747054
1 file changed +1 -1
builtin/fetch-pack.c
+1 -1
@@ -1082,8 +1082,8 @@ struct ref *fetch_pack(struct fetch_pack_args *my_args,
1082 }
1083
1084 if (heads && nr_heads) {
1085 - nr_heads = remove_duplicates(nr_heads, heads);
1085 qsort(heads, nr_heads, sizeof(*heads), compare_heads);
1086 + nr_heads = remove_duplicates(nr_heads, heads);
1087 }
1088
1089 if (!ref) {