Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.kernel.org/pub/scm/git/git.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJeff King <peff@peff.net>2015-12-21 09:20:33 +0300
committerJunio C Hamano <gitster@pobox.com>2015-12-22 01:36:28 +0300
commit9d98bbf5785708da4effc9b8f34ba6e18d726625 (patch)
tree26258229df1ac0124b99f7d0005fb00ea6db77fc /pack-revindex.h
parentf4015337daf130944393296550dd7d8a9c172325 (diff)
pack-revindex: store entries directly in packed_git
A pack_revindex struct has two elements: the revindex entries themselves, and a pointer to the packed_git. We need both to do lookups, because only the latter knows things like the number of objects in the pack. Now that packed_git contains the pack_revindex struct it's just as easy to pass around the packed_git itself, and we do not need the extra back-pointer. We can instead just store the entries directly in the pack. All functions which took a pack_revindex now just take a packed_git. We still lazy-load in find_pack_revindex, so most callers are unaffected. The exception is the bitmap code, which computes the revindex and caches the pointer when we load the bitmaps. We can continue to load, drop the extra cache pointer, and just access bitmap_git.pack.revindex directly. Signed-off-by: Jeff King <peff@peff.net> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 'pack-revindex.h')
-rw-r--r--pack-revindex.h11
1 files changed, 4 insertions, 7 deletions
diff --git a/pack-revindex.h b/pack-revindex.h
index d737f98965..e262f3efe8 100644
--- a/pack-revindex.h
+++ b/pack-revindex.h
@@ -1,18 +1,15 @@
#ifndef PACK_REVINDEX_H
#define PACK_REVINDEX_H
+struct packed_git;
+
struct revindex_entry {
off_t offset;
unsigned int nr;
};
-struct pack_revindex {
- struct packed_git *p;
- struct revindex_entry *revindex;
-};
-
-struct pack_revindex *revindex_for_pack(struct packed_git *p);
-int find_revindex_position(struct pack_revindex *pridx, off_t ofs);
+void load_pack_revindex(struct packed_git *p);
+int find_revindex_position(struct packed_git *p, off_t ofs);
struct revindex_entry *find_pack_revindex(struct packed_git *p, off_t ofs);