strbuf_release(&path);
}
+static void repack_prepare_midx_command(struct child_process *cmd,
+ struct repack_write_midx_opts *opts,
+ const char *subcommand)
+{
+ cmd->git_cmd = 1;
+
+ strvec_pushl(&cmd->args, "multi-pack-index", subcommand, NULL);
+
+ if (opts->show_progress)
+ strvec_push(&cmd->args, "--progress");
+ else
+ strvec_push(&cmd->args, "--no-progress");
+
+ if (opts->write_bitmaps)
+ strvec_push(&cmd->args, "--bitmap");
+}
+
int write_midx_included_packs(struct repack_write_midx_opts *opts)
{
struct child_process cmd = CHILD_PROCESS_INIT;
goto done;
cmd.in = -1;
- cmd.git_cmd = 1;
- strvec_push(&cmd.args, "multi-pack-index");
- strvec_pushl(&cmd.args, "write", "--stdin-packs", NULL);
-
- if (opts->show_progress)
- strvec_push(&cmd.args, "--progress");
- else
- strvec_push(&cmd.args, "--no-progress");
-
- if (opts->write_bitmaps)
- strvec_push(&cmd.args, "--bitmap");
+ repack_prepare_midx_command(&cmd, opts, "write");
+ strvec_push(&cmd.args, "--stdin-packs");
if (preferred)
strvec_pushf(&cmd.args, "--preferred-pack=%s",