mirror of
https://github.com/git/git
synced 2024-09-13 05:14:36 +00:00
fetch-pack: sort incoming heads list earlier
Commit4435968
started sorting heads fed to fetch-pack so that later commits could use more optimized algorithms; commit7db8d53
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>
This commit is contained in:
parent
a0de28805d
commit
3d2a33e57f
|
@ -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) {
|
||||
|
|
Loading…
Reference in a new issue