summaryrefslogtreecommitdiff
path: root/builtin/fetch-pack.c
diff options
context:
space:
mode:
authorJeff King <peff@peff.net>2012-05-24 06:04:51 (GMT)
committerJunio C Hamano <gitster@pobox.com>2012-05-24 17:02:37 (GMT)
commit3d2a33e57faa84be3ab83a80c8b75dad3e747054 (patch)
tree7b008bac735085acddc1c0cf13f45c74497b4a8c /builtin/fetch-pack.c
parenta0de28805dceaca86a6f7bedfd3e8c227b781d9d (diff)
downloadgit-3d2a33e57faa84be3ab83a80c8b75dad3e747054.zip
git-3d2a33e57faa84be3ab83a80c8b75dad3e747054.tar.gz
git-3d2a33e57faa84be3ab83a80c8b75dad3e747054.tar.bz2
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>
Diffstat (limited to 'builtin/fetch-pack.c')
-rw-r--r--builtin/fetch-pack.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/builtin/fetch-pack.c b/builtin/fetch-pack.c
index 8a72473..b18ba05 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) {