summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: bad68ec)
raw | patch | inline | side by side (parent: bad68ec)
author | Junio C Hamano <junkio@cox.net> | |
Tue, 25 Apr 2006 23:37:08 +0000 (16:37 -0700) | ||
committer | Junio C Hamano <junkio@cox.net> | |
Tue, 25 Apr 2006 23:37:08 +0000 (16:37 -0700) |
Signed-off-by: Junio C Hamano <junkio@cox.net>
fsck-objects.c | patch | blob | history |
diff --git a/fsck-objects.c b/fsck-objects.c
index 59b25904cb0f6e87594e2bad20db3ee2aa726aef..cc09143a92a64a0d7e14fb7195cd39c05bb0b49f 100644 (file)
--- a/fsck-objects.c
+++ b/fsck-objects.c
#include "tag.h"
#include "refs.h"
#include "pack.h"
+#include "cache-tree.h"
#define REACHABLE 0x0001
return 0;
}
+static int fsck_cache_tree(struct cache_tree *it)
+{
+ int i;
+ int err = 0;
+
+ if (0 <= it->entry_count) {
+ struct object *obj = parse_object(it->sha1);
+ if (obj->type != tree_type)
+ err |= objerror(obj, "non-tree in cache-tree");
+ }
+ for (i = 0; i < it->subtree_nr; i++)
+ err |= fsck_cache_tree(it->down[i]->cache_tree);
+ return err;
+}
+
int main(int argc, char **argv)
{
int i, heads;
obj->used = 1;
mark_reachable(obj, REACHABLE);
}
+ if (active_cache_tree)
+ fsck_cache_tree(active_cache_tree);
}
check_connectivity();