提交 53dc3f3e 编写于 作者: J Junio C Hamano

Teach fsck-objects about cache-tree.

Signed-off-by: NJunio C Hamano <junkio@cox.net>
上级 bad68ec9
......@@ -8,6 +8,7 @@
#include "tag.h"
#include "refs.h"
#include "pack.h"
#include "cache-tree.h"
#define REACHABLE 0x0001
......@@ -438,6 +439,21 @@ static int fsck_head_link(void)
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;
......@@ -547,6 +563,8 @@ int main(int argc, char **argv)
obj->used = 1;
mark_reachable(obj, REACHABLE);
}
if (active_cache_tree)
fsck_cache_tree(active_cache_tree);
}
check_connectivity();
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册