summaryrefslogtreecommitdiffstats
path: root/builtin/pack-objects.c
diff options
context:
space:
mode:
authorJunio C Hamano <gitster@pobox.com>2018-02-13 22:39:06 +0100
committerJunio C Hamano <gitster@pobox.com>2018-02-13 22:39:06 +0100
commit867622398f7e7a8a7c6e7a5418e7cbdcffc44d02 (patch)
tree7e42f2fe39327130caa1fdbfc221b85b8cb3a163 /builtin/pack-objects.c
parentMerge branch 'ot/mru-on-list' (diff)
parentmru: Replace mru.[ch] with list.h implementation (diff)
downloadgit-867622398f7e7a8a7c6e7a5418e7cbdcffc44d02.tar.xz
git-867622398f7e7a8a7c6e7a5418e7cbdcffc44d02.zip
Merge branch 'gs/retire-mru'
Retire mru API as it does not give enough abstraction over underlying list API to be worth it. * gs/retire-mru: mru: Replace mru.[ch] with list.h implementation
Diffstat (limited to 'builtin/pack-objects.c')
-rw-r--r--builtin/pack-objects.c9
1 files changed, 4 insertions, 5 deletions
diff --git a/builtin/pack-objects.c b/builtin/pack-objects.c
index 0c3d03de48..83dcbc9773 100644
--- a/builtin/pack-objects.c
+++ b/builtin/pack-objects.c
@@ -26,7 +26,7 @@
#include "reachable.h"
#include "sha1-array.h"
#include "argv-array.h"
-#include "mru.h"
+#include "list.h"
#include "packfile.h"
static const char *pack_usage[] = {
@@ -1026,9 +1026,8 @@ static int want_object_in_pack(const struct object_id *oid,
return want;
}
- list_for_each(pos, &packed_git_mru.list) {
- struct mru *entry = list_entry(pos, struct mru, list);
- struct packed_git *p = entry->item;
+ list_for_each(pos, &packed_git_mru) {
+ struct packed_git *p = list_entry(pos, struct packed_git, mru);
off_t offset;
if (p == *found_pack)
@@ -1045,7 +1044,7 @@ static int want_object_in_pack(const struct object_id *oid,
}
want = want_found_object(exclude, p);
if (!exclude && want > 0)
- mru_mark(&packed_git_mru, entry);
+ list_move(&p->mru, &packed_git_mru);
if (want != -1)
return want;
}