summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: a3ed755)
raw | patch | inline | side by side (parent: a3ed755)
author | Nguyễn Thái Ngọc Duy <pclouds@gmail.com> | |
Mon, 7 Nov 2011 02:59:24 +0000 (09:59 +0700) | ||
committer | Junio C Hamano <gitster@pobox.com> | |
Mon, 7 Nov 2011 04:31:28 +0000 (20:31 -0800) |
verify_packfile() checks for whole pack integerity first, then each
object individually. Once we get past whole pack check, we can
identify all objects in the pack. If there's an error with one object,
we should continue to check the next objects to salvage as many
objects as possible instead of stopping the process.
Signed-off-by: Nguyễn Thái Ngọc Duy <pclouds@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
object individually. Once we get past whole pack check, we can
identify all objects in the pack. If there's an error with one object,
we should continue to check the next objects to salvage as many
objects as possible instead of stopping the process.
Signed-off-by: Nguyễn Thái Ngọc Duy <pclouds@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
pack-check.c | patch | blob | history |
diff --git a/pack-check.c b/pack-check.c
index 0c19b6e5a5677bd14989175abddc119381fac4ef..7ac9b3a6815f2b6f7c017b54f10e8a4b5f8070d6 100644 (file)
--- a/pack-check.c
+++ b/pack-check.c
p->pack_name, (uintmax_t)offset);
}
data = unpack_entry(p, entries[i].offset, &type, &size);
- if (!data) {
+ if (!data)
err = error("cannot unpack %s from %s at offset %"PRIuMAX"",
sha1_to_hex(entries[i].sha1), p->pack_name,
(uintmax_t)entries[i].offset);
- break;
- }
- if (check_sha1_signature(entries[i].sha1, data, size, typename(type))) {
+ else if (check_sha1_signature(entries[i].sha1, data, size, typename(type)))
err = error("packed %s from %s is corrupt",
sha1_to_hex(entries[i].sha1), p->pack_name);
- free(data);
- break;
- }
free(data);
}
free(entries);