summaryrefslogtreecommitdiff
path: root/pack-check.c
diff options
context:
space:
mode:
authorLibravatar Junio C Hamano <junkio@cox.net>2006-04-27 21:38:43 -0700
committerLibravatar Junio C Hamano <junkio@cox.net>2006-04-27 21:38:43 -0700
commitac92095ff2c47731ba9a2a7779cd797b973ffc74 (patch)
treebcefd5a751f8289883965c12858cb6c8b9213782 /pack-check.c
parentMerge branch 'np/delta' into next (diff)
parentbuilt-in count-objects. (diff)
downloadtgif-ac92095ff2c47731ba9a2a7779cd797b973ffc74.tar.xz
Merge branch 'jc/count' into next
* jc/count: built-in count-objects. pack-objects: update size heuristucs. verify-pack: check integrity in a saner order.
Diffstat (limited to 'pack-check.c')
-rw-r--r--pack-check.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/pack-check.c b/pack-check.c
index 84ed90d369..e57587909e 100644
--- a/pack-check.c
+++ b/pack-check.c
@@ -29,12 +29,12 @@ static int verify_packfile(struct packed_git *p)
pack_base = p->pack_base;
SHA1_Update(&ctx, pack_base, pack_size - 20);
SHA1_Final(sha1, &ctx);
- if (memcmp(sha1, index_base + index_size - 40, 20))
- return error("Packfile %s SHA1 mismatch with idx",
- p->pack_name);
if (memcmp(sha1, pack_base + pack_size - 20, 20))
return error("Packfile %s SHA1 mismatch with itself",
p->pack_name);
+ if (memcmp(sha1, index_base + index_size - 40, 20))
+ return error("Packfile %s SHA1 mismatch with idx",
+ p->pack_name);
/* Make sure everything reachable from idx is valid. Since we
* have verified that nr_objects matches between idx and pack,