}
static int finish_pack_objects_cmd(const struct git_hash_algo *algop,
+ struct write_pack_opts *opts,
struct child_process *cmd,
- struct string_list *names,
- int local)
+ struct string_list *names)
{
FILE *out;
+ int local = write_pack_opts_is_local(opts);
struct strbuf line = STRBUF_INIT;
out = xfdopen(cmd->out, "r");
*/
if (local) {
item = string_list_append(names, line.buf);
- item->util = generated_pack_populate(line.buf, packtmp);
+ item->util = generated_pack_populate(line.buf,
+ opts->packtmp);
}
}
fclose(out);
FILE *in;
int ret;
const char *caret;
- int local = write_pack_opts_is_local(opts);
const char *pack_prefix = write_pack_opts_pack_prefix(opts);
prepare_pack_objects(&cmd, opts->po_args, opts->destination);
fprintf(in, "%s%s.pack\n", caret, item->string);
fclose(in);
- return finish_pack_objects_cmd(existing->repo->hash_algo, &cmd, names,
- local);
+ return finish_pack_objects_cmd(existing->repo->hash_algo, opts, &cmd,
+ names);
}
static void combine_small_cruft_packs(FILE *in, size_t combine_cruft_below_size,
struct string_list_item *item;
FILE *in;
int ret;
- int local = write_pack_opts_is_local(opts);
const char *pack_prefix = write_pack_opts_pack_prefix(opts);
prepare_pack_objects(&cmd, opts->po_args, opts->destination);
fprintf(in, "%s.pack\n", item->string);
fclose(in);
- return finish_pack_objects_cmd(existing->repo->hash_algo, &cmd, names,
- local);
+ return finish_pack_objects_cmd(existing->repo->hash_algo, opts, &cmd,
+ names);
}
int cmd_repack(int argc,
struct existing_packs existing = EXISTING_PACKS_INIT;
struct pack_geometry geometry = { 0 };
struct tempfile *refs_snapshot = NULL;
+ struct write_pack_opts opts = { 0 };
int i, ret;
int show_progress;
fclose(in);
}
- ret = finish_pack_objects_cmd(repo->hash_algo, &cmd, &names, 1);
+ opts.packdir = packdir;
+ opts.destination = packdir;
+ opts.packtmp = packtmp;
+ ret = finish_pack_objects_cmd(repo->hash_algo, &opts, &cmd, &names);
if (ret)
goto cleanup;