194
return 0;
195
}
196
197
-static void write_rev_header(struct hashfile *f)
197
+static void write_rev_header(const struct git_hash_algo *hash_algo,
198
+ struct hashfile *f)
199
{
200
hashwrite_be32(f, RIDX_SIGNATURE);
201
hashwrite_be32(f, RIDX_VERSION);
201
- hashwrite_be32(f, oid_version(the_hash_algo));
202
+ hashwrite_be32(f, oid_version(hash_algo));
203
}
204
205
static void write_rev_index_positions(struct hashfile *f,
216
hashwrite(f, hash, the_hash_algo->rawsz);
217
}
218
218
-char *write_rev_file(const char *rev_name,
219
+char *write_rev_file(const struct git_hash_algo *hash_algo,
220
+ const char *rev_name,
221
struct pack_idx_entry **objects,
222
uint32_t nr_objects,
223
const unsigned char *hash,
235
pack_order[i] = i;
236
QSORT_S(pack_order, nr_objects, pack_order_cmp, objects);
237
236
- ret = write_rev_file_order(rev_name, pack_order, nr_objects, hash,
237
- flags);
238
+ ret = write_rev_file_order(hash_algo, rev_name, pack_order, nr_objects,
239
+ hash, flags);
240
241
free(pack_order);
242
243
return ret;
244
}
245
244
-char *write_rev_file_order(const char *rev_name,
246
+char *write_rev_file_order(const struct git_hash_algo *hash_algo,
247
+ const char *rev_name,
248
uint32_t *pack_order,
249
uint32_t nr_objects,
250
const unsigned char *hash,
283
return NULL;
284
}
285
283
- write_rev_header(f);
286
+ write_rev_header(hash_algo, f);
287
288
write_rev_index_positions(f, pack_order, nr_objects);
289
write_rev_trailer(f, hash);
571
if (adjust_shared_perm(*idx_tmp_name))
572
die_errno("unable to make temporary index file readable");
573
571
- rev_tmp_name = write_rev_file(NULL, written_list, nr_written, hash,
572
- pack_idx_opts->flags);
574
+ rev_tmp_name = write_rev_file(hash_algo, NULL, written_list, nr_written,
575
+ hash, pack_idx_opts->flags);
576
577
if (pack_idx_opts->flags & WRITE_MTIMES) {
578
mtimes_tmp_name = write_mtimes_file(to_pack, written_list,