aboutsummaryrefslogtreecommitdiff
path: root/pack-check.c
diff options
context:
space:
mode:
Diffstat (limited to 'pack-check.c')
-rw-r--r--pack-check.c9
1 files changed, 7 insertions, 2 deletions
diff --git a/pack-check.c b/pack-check.c
index c168642c0..3623c716e 100644
--- a/pack-check.c
+++ b/pack-check.c
@@ -128,12 +128,17 @@ static void show_pack_info(struct packed_git *p)
int verify_pack(struct packed_git *p, int verbose)
{
- off_t index_size = p->index_size;
- const unsigned char *index_base = p->index_data;
+ off_t index_size;
+ const unsigned char *index_base;
SHA_CTX ctx;
unsigned char sha1[20];
int ret;
+ if (open_pack_index(p))
+ return error("packfile %s index not opened", p->pack_name);
+ index_size = p->index_size;
+ index_base = p->index_data;
+
ret = 0;
/* Verify SHA1 sum of the index file */
SHA1_Init(&ctx);