fetch-pack: sort the list of incoming refs
commit9e8e704f0bc14da325aa63f639c6dc782c81e26f
authorJeff King <peff@peff.net>
Mon, 21 May 2012 22:19:51 +0000 (21 18:19 -0400)
committerJunio C Hamano <gitster@pobox.com>
Tue, 22 May 2012 20:31:03 +0000 (22 13:31 -0700)
tree915006dec9c93f6229dc36f7ee6f220d1d9e5b39
parented81c76bc3a9440e37b3512c9c2b742c6ca92c6f
fetch-pack: sort the list of incoming refs

Having the list sorted means we can avoid some quadratic
algorithms when comparing lists.

These should typically be sorted already, but they do come
from the remote, so let's be extra careful. Our ref-sorting
implementation does a mergesort, so we do not have to care
about performance degrading in the common case that the list
is already sorted.

Signed-off-by: Jeff King <peff@peff.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
builtin/fetch-pack.c