|
1 |
| -#define USE_THE_REPOSITORY_VARIABLE |
2 | 1 | #define DISABLE_SIGN_COMPARE_WARNINGS
|
3 | 2 |
|
4 | 3 | #include "git-compat-util.h"
|
@@ -44,7 +43,7 @@ int check_pack_crc(struct packed_git *p, struct pack_window **w_curs,
|
44 | 43 | } while (len);
|
45 | 44 |
|
46 | 45 | index_crc = p->index_data;
|
47 |
| - index_crc += 2 + 256 + (size_t)p->num_objects * (the_hash_algo->rawsz/4) + nr; |
| 46 | + index_crc += 2 + 256 + (size_t)p->num_objects * (p->repo->hash_algo->rawsz/4) + nr; |
48 | 47 |
|
49 | 48 | return data_crc != ntohl(*index_crc);
|
50 | 49 | }
|
@@ -81,11 +80,11 @@ static int verify_packfile(struct repository *r,
|
81 | 80 | } while (offset < pack_sig_ofs);
|
82 | 81 | git_hash_final(hash, &ctx);
|
83 | 82 | pack_sig = use_pack(p, w_curs, pack_sig_ofs, NULL);
|
84 |
| - if (!hasheq(hash, pack_sig, the_repository->hash_algo)) |
| 83 | + if (!hasheq(hash, pack_sig, r->hash_algo)) |
85 | 84 | err = error("%s pack checksum mismatch",
|
86 | 85 | p->pack_name);
|
87 | 86 | if (!hasheq(index_base + index_size - r->hash_algo->hexsz, pack_sig,
|
88 |
| - the_repository->hash_algo)) |
| 87 | + r->hash_algo)) |
89 | 88 | err = error("%s pack checksum does not match its index",
|
90 | 89 | p->pack_name);
|
91 | 90 | unuse_pack(w_curs);
|
@@ -132,7 +131,7 @@ static int verify_packfile(struct repository *r,
|
132 | 131 | unuse_pack(w_curs);
|
133 | 132 |
|
134 | 133 | if (type == OBJ_BLOB &&
|
135 |
| - repo_settings_get_big_file_threshold(the_repository) <= size) { |
| 134 | + repo_settings_get_big_file_threshold(r) <= size) { |
136 | 135 | /*
|
137 | 136 | * Let stream_object_signature() check it with
|
138 | 137 | * the streaming interface; no point slurping
|
@@ -181,7 +180,7 @@ int verify_pack_index(struct packed_git *p)
|
181 | 180 | return error("packfile %s index not opened", p->pack_name);
|
182 | 181 |
|
183 | 182 | /* Verify SHA1 sum of the index file */
|
184 |
| - if (!hashfile_checksum_valid(the_repository->hash_algo, p->index_data, p->index_size)) |
| 183 | + if (!hashfile_checksum_valid(p->repo->hash_algo, p->index_data, p->index_size)) |
185 | 184 | err = error("Packfile index for %s hash mismatch",
|
186 | 185 | p->pack_name);
|
187 | 186 | return err;
|
|
0 commit comments