]> git.ipfire.org Git - thirdparty/git.git/blobdiff - builtin/pack-objects.c
mru: use double-linked list from list.h
[thirdparty/git.git] / builtin / pack-objects.c
index f721137eaf88143aa2ae3f8c67b97fbceccbb6cf..ba812349e0aab35c2a009fe3c7da407ec8b7f48c 100644 (file)
@@ -995,8 +995,8 @@ static int want_object_in_pack(const unsigned char *sha1,
                               struct packed_git **found_pack,
                               off_t *found_offset)
 {
-       struct mru_entry *entry;
        int want;
+       struct list_head *pos;
 
        if (!exclude && local && has_loose_object_nonlocal(sha1))
                return 0;
@@ -1012,7 +1012,8 @@ static int want_object_in_pack(const unsigned char *sha1,
                        return want;
        }
 
-       for (entry = packed_git_mru.head; entry; entry = entry->next) {
+       list_for_each(pos, &packed_git_mru.list) {
+               struct mru *entry = list_entry(pos, struct mru, list);
                struct packed_git *p = entry->item;
                off_t offset;