use qsort(3) instead of mergesort(3) to avoid a large spike in memory usage
diff --git a/libexec/got-index-pack/got-index-pack.c b/libexec/got-index-pack/got-index-pack.c
index 6d9aba3..9ebc198 100644
--- a/libexec/got-index-pack/got-index-pack.c
+++ b/libexec/got-index-pack/got-index-pack.c
@@ -511,7 +511,7 @@ make_packidx(struct got_packidx *packidx, int nobj,
int i;
uint32_t idx = 0;
- mergesort(objects, nobj, sizeof(struct got_indexed_object),
+ qsort(objects, nobj, sizeof(struct got_indexed_object),
indexed_obj_cmp);
memset(packidx->hdr.fanout_table, 0,