assume pdata is already zero'd by caller */
| 133 | |
| 134 | /* assume pdata is already zero'd by caller */ |
| 135 | void prepare_packing_data(struct repository *r, struct packing_data *pdata) |
| 136 | { |
| 137 | pdata->repo = r; |
| 138 | |
| 139 | if (git_env_bool("GIT_TEST_FULL_IN_PACK_ARRAY", 0)) { |
| 140 | /* |
| 141 | * do not initialize in_pack_by_idx[] to force the |
| 142 | * slow path in oe_in_pack() |
| 143 | */ |
| 144 | } else { |
| 145 | prepare_in_pack_by_idx(pdata); |
| 146 | } |
| 147 | |
| 148 | pdata->oe_size_limit = git_env_ulong("GIT_TEST_OE_SIZE", |
| 149 | 1U << OE_SIZE_BITS); |
| 150 | pdata->oe_delta_size_limit = git_env_ulong("GIT_TEST_OE_DELTA_SIZE", |
| 151 | 1UL << OE_DELTA_SIZE_BITS); |
| 152 | init_recursive_mutex(&pdata->odb_lock); |
| 153 | } |
| 154 | |
| 155 | void clear_packing_data(struct packing_data *pdata) |
| 156 | { |