aboutsummaryrefslogtreecommitdiff
path: root/fsck-objects.c
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@osdl.org>2006-06-29 21:38:55 -0700
committerJunio C Hamano <junkio@cox.net>2006-06-29 23:48:31 -0700
commitfc046a75d539a78e6b2c16534c4078617a69a327 (patch)
tree03842bdfab234301a0a0c693f30c087a58eeb51f /fsck-objects.c
parent8dbbd14ea3ae1b4e825f1e7d314afddf26c67298 (diff)
downloadgit-fc046a75d539a78e6b2c16534c4078617a69a327.tar.gz
git-fc046a75d539a78e6b2c16534c4078617a69a327.tar.xz
Abstract out accesses to object hash array
There are a few special places where some programs accessed the object hash array directly, which bothered me because I wanted to play with some simple re-organizations. So this patch makes the object hash array data structures all entirely local to object.c, and the few users who wanted to look at it now get to use a function to query how many object index entries there can be, and to actually access the array. Signed-off-by: Linus Torvalds <torvalds@osdl.org> Signed-off-by: Junio C Hamano <junkio@cox.net>
Diffstat (limited to 'fsck-objects.c')
-rw-r--r--fsck-objects.c7
1 files changed, 4 insertions, 3 deletions
diff --git a/fsck-objects.c b/fsck-objects.c
index 769bb2a6a..ef54a8a41 100644
--- a/fsck-objects.c
+++ b/fsck-objects.c
@@ -60,12 +60,13 @@ static int objwarning(struct object *obj, const char *err, ...)
static void check_connectivity(void)
{
- int i;
+ int i, max;
/* Look up all the requirements, warn about missing objects.. */
- for (i = 0; i < obj_allocs; i++) {
+ max = get_max_object_index();
+ for (i = 0; i < max; i++) {
const struct object_refs *refs;
- struct object *obj = objs[i];
+ struct object *obj = get_indexed_object(i);
if (!obj)
continue;