-/* We sort the packs according to the date of the latest commit. That
- * in turn indicates how young the pack is, and in general we would
- * want to depend on younger packs.
- */
-static unsigned long get_latest_commit_date(struct packed_git *p)
-{
- unsigned char sha1[20];
- struct object *o;
- int num = num_packed_objects(p);
- int i;
- unsigned long latest = 0;
-
- for (i = 0; i < num; i++) {
- if (nth_packed_object_sha1(p, i, sha1))
- die("corrupt pack file %s?", p->pack_name);
- if ((o = parse_object_cheap(sha1)) == NULL)
- die("cannot parse %s", sha1_to_hex(sha1));
- if (o->type == commit_type) {
- struct commit *commit = (struct commit *)o;
- if (latest < commit->date)
- latest = commit->date;
- }
- }
- return latest;
-}
-