summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: cf21919)
raw | patch | inline | side by side (parent: cf21919)
author | Junio C Hamano <junkio@cox.net> | |
Sun, 10 Jul 2005 22:40:43 +0000 (15:40 -0700) | ||
committer | Linus Torvalds <torvalds@g5.osdl.org> | |
Sun, 10 Jul 2005 23:16:34 +0000 (16:16 -0700) |
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: Linus Torvalds <torvalds@osdl.org>
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: Linus Torvalds <torvalds@osdl.org>
fsck-cache.c | patch | blob | history |
diff --git a/fsck-cache.c b/fsck-cache.c
index 48be6553a3b1d9b7e4b9a3382646bf753e15a4f3..8e21bf1327a60840273973c08216c1387aac95b8 100644 (file)
--- a/fsck-cache.c
+++ b/fsck-cache.c
struct packed_git *p;
prepare_alt_odb();
for (j = 0; alt_odb[j].base; j++) {
- alt_odb[j].name[-1] = 0; /* was slash */
- fsck_object_dir(alt_odb[j].base);
- alt_odb[j].name[-1] = '/';
+ char namebuf[PATH_MAX];
+ int namelen = alt_odb[j].name - alt_odb[j].base;
+ memcpy(namebuf, alt_odb[j].base, namelen);
+ namebuf[namelen - 1] = 0;
+ fsck_object_dir(namebuf);
}
prepare_packed_git();
for (p = packed_git; p; p = p->next)