if (status)
return "index-pack fork failed";
- lockfile = index_pack_lockfile(child.out, NULL);
+ lockfile = index_pack_lockfile(the_repository, child.out, NULL);
if (lockfile) {
pack_lockfile = register_tempfile(lockfile);
free(lockfile);
die(_("fetch-pack: unable to fork off %s"), cmd_name);
if (do_keep && (pack_lockfiles || fsck_objects)) {
int is_well_formed;
- char *pack_lockfile = index_pack_lockfile(cmd.out, &is_well_formed);
+ char *pack_lockfile = index_pack_lockfile(the_repository,
+ cmd.out,
+ &is_well_formed);
if (!is_well_formed)
die(_("fetch-pack: invalid index-pack output"));
fsync_component_or_die(FSYNC_COMPONENT_PACK, pack_fd, pack_name);
}
-char *index_pack_lockfile(int ip_out, int *is_well_formed)
+char *index_pack_lockfile(struct repository *r, int ip_out, int *is_well_formed)
{
char packname[GIT_MAX_HEXSZ + 6];
- const int len = the_hash_algo->hexsz + 6;
+ const int len = r->hash_algo->hexsz + 6;
/*
* The first thing we expect from index-pack's output
packname[len-1] = 0;
if (skip_prefix(packname, "keep\t", &name))
return xstrfmt("%s/pack/pack-%s.keep",
- repo_get_object_directory(the_repository), name);
+ repo_get_object_directory(r), name);
return NULL;
}
if (is_well_formed)
void fixup_pack_header_footer(const struct git_hash_algo *, int,
unsigned char *, const char *, uint32_t,
unsigned char *, off_t);
-char *index_pack_lockfile(int fd, int *is_well_formed);
+char *index_pack_lockfile(struct repository *r, int fd, int *is_well_formed);
struct ref;