summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJunio C Hamano <junkio@cox.net>2006-04-27 22:42:32 (GMT)
committerJunio C Hamano <junkio@cox.net>2006-04-27 22:42:32 (GMT)
commitbd346f105dc6f343eb577e4b25dbc1fa098cff33 (patch)
treefc5297e7c778740712a4df861f5e620846e375a1
parente5de2c5e308a23b8f1531bbac2f100af7ab0767b (diff)
parent55e1805dffeb5d2a8ccd717b2d07ca8887436a69 (diff)
downloadgit-bd346f105dc6f343eb577e4b25dbc1fa098cff33.zip
git-bd346f105dc6f343eb577e4b25dbc1fa098cff33.tar.gz
git-bd346f105dc6f343eb577e4b25dbc1fa098cff33.tar.bz2
Merge branch 'fix'
* fix: verify-pack: check integrity in a saner order.
-rw-r--r--pack-check.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/pack-check.c b/pack-check.c
index 84ed90d..e575879 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,