Skip to content

Commit

Permalink
Merge branch 'fix'
Browse files Browse the repository at this point in the history
* fix:
  verify-pack: check integrity in a saner order.
  • Loading branch information
Junio C Hamano committed Apr 27, 2006
2 parents e5de2c5 + 55e1805 commit bd346f1
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions pack-check.c
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down

0 comments on commit bd346f1

Please sign in to comment.