Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.kernel.org/pub/scm/git/git.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to 'pack-check.c')
-rw-r--r--pack-check.c9
1 files changed, 6 insertions, 3 deletions
diff --git a/pack-check.c b/pack-check.c
index 48d818ee7b..d8d8f91de6 100644
--- a/pack-check.c
+++ b/pack-check.c
@@ -127,7 +127,7 @@ static int verify_packfile(struct repository *r,
if (type == OBJ_BLOB && big_file_threshold <= size) {
/*
- * Let check_object_signature() check it with
+ * Let stream_object_signature() check it with
* the streaming interface; no point slurping
* the data in-core only to discard.
*/
@@ -142,8 +142,11 @@ static int verify_packfile(struct repository *r,
err = error("cannot unpack %s from %s at offset %"PRIuMAX"",
oid_to_hex(&oid), p->pack_name,
(uintmax_t)entries[i].offset);
- else if (check_object_signature(r, &oid, data, size,
- type_name(type), NULL) < 0)
+ else if (data && check_object_signature(r, &oid, data, size,
+ type_name(type)) < 0)
+ err = error("packed %s from %s is corrupt",
+ oid_to_hex(&oid), p->pack_name);
+ else if (!data && stream_object_signature(r, &oid) < 0)
err = error("packed %s from %s is corrupt",
oid_to_hex(&oid), p->pack_name);
else if (fn) {