summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: da6abf5)
raw | patch | inline | side by side (parent: da6abf5)
author | Linus Torvalds <torvalds@ppc970.osdl.org> | |
Sun, 24 Apr 2005 21:10:55 +0000 (14:10 -0700) | ||
committer | Linus Torvalds <torvalds@ppc970.osdl.org> | |
Sun, 24 Apr 2005 21:10:55 +0000 (14:10 -0700) |
We should _not_ mark a blob object "parsed" just because we
looked it up: it gets marked that way only once we've actually
seen it. Otherwise we can never notice a missing blob.
looked it up: it gets marked that way only once we've actually
seen it. Otherwise we can never notice a missing blob.
blob.c | patch | blob | history | |
fsck-cache.c | patch | blob | history |
index 35031af62bbcf61a59edf22f3502ec62e3bb2765..f79f5abd00ba2eb0b25cf244e0b21b559b86e1d7 100644 (file)
--- a/blob.c
+++ b/blob.c
memset(ret, 0, sizeof(struct blob));
created_object(sha1, &ret->object);
ret->object.type = blob_type;
- ret->object.parsed = 1;
return ret;
}
if (obj->parsed && obj->type != blob_type) {
diff --git a/fsck-cache.c b/fsck-cache.c
index 96b8eb161107cd3219975d93a44874a5455b702e..985adb68bb50d087895e2a2cb0b7b5d009f627f2 100644 (file)
--- a/fsck-cache.c
+++ b/fsck-cache.c
return 0;
}
+static int fsck_blob(unsigned char *sha1, void *data, unsigned long size)
+{
+ struct blob *blob = lookup_blob(sha1);
+ blob->object.parsed = 1;
+ return 0;
+}
+
static int fsck_entry(unsigned char *sha1, char *tag, void *data,
unsigned long size)
{
if (!strcmp(tag, "blob")) {
- lookup_blob(sha1); /* Nothing to check; but notice it. */
+ if (fsck_blob(sha1, data, size) < 0)
+ return -1;
} else if (!strcmp(tag, "tree")) {
if (fsck_tree(sha1, data, size) < 0)
return -1;