提交 a3eb250f 编写于 作者: J Junio C Hamano 提交者: Linus Torvalds

[PATCH] alternate object store and fsck

The location alt_odb[j].name[0..] is filled with ??/?{38} to form a sha1
filename to try, but I was too lazy to allocate a copy, so while
fsck_object_dir() is running for the directory, the filenames ??/?{38}
are filled after NUL (usually and always the location should have '/'),
making them "not found".

This should fix it.
Signed-off-by: NLinus Torvalds <torvalds@osdl.org>
上级 cf219196
...@@ -416,9 +416,11 @@ int main(int argc, char **argv) ...@@ -416,9 +416,11 @@ int main(int argc, char **argv)
struct packed_git *p; struct packed_git *p;
prepare_alt_odb(); prepare_alt_odb();
for (j = 0; alt_odb[j].base; j++) { for (j = 0; alt_odb[j].base; j++) {
alt_odb[j].name[-1] = 0; /* was slash */ char namebuf[PATH_MAX];
fsck_object_dir(alt_odb[j].base); int namelen = alt_odb[j].name - alt_odb[j].base;
alt_odb[j].name[-1] = '/'; memcpy(namebuf, alt_odb[j].base, namelen);
namebuf[namelen - 1] = 0;
fsck_object_dir(namebuf);
} }
prepare_packed_git(); prepare_packed_git();
for (p = packed_git; p; p = p->next) for (p = packed_git; p; p = p->next)
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册