Commit Diff


commit - c8fc6d14c6e1f80c4c21a32c3e40a6bfe4638fcc
commit + bd00a07c62ad3b363bcd50c100f4b45b9e452d02
blob - 152d884fac207c0cd24a0d4af25e70dd2bb42a8e
blob + 0054791059b672a6e00b7f9d1da002661b53409d
--- lib/repository_admin.c
+++ lib/repository_admin.c
@@ -70,6 +70,11 @@ get_reflist_object_ids(struct got_object_id ***ids, in
 	*ids = NULL;
 	*nobjects = 0;
 
+	err = got_reflist_sort(refs,
+	    got_ref_cmp_by_commit_timestamp_descending, repo);
+	if (err)
+		return err;
+
 	*ids = reallocarray(NULL, alloc_chunksz, sizeof(struct got_object_id *));
 	if (*ids == NULL)
 		return got_error_from_errno("reallocarray");