| 10 | #include "tempfile.h" |
| 11 | |
| 12 | void prepare_pack_objects(struct child_process *cmd, |
| 13 | const struct pack_objects_args *args, |
| 14 | const char *out) |
| 15 | { |
| 16 | strvec_push(&cmd->args, "pack-objects"); |
| 17 | if (args->window) |
| 18 | strvec_pushf(&cmd->args, "--window=%s", args->window); |
| 19 | if (args->window_memory) |
| 20 | strvec_pushf(&cmd->args, "--window-memory=%s", args->window_memory); |
| 21 | if (args->depth) |
| 22 | strvec_pushf(&cmd->args, "--depth=%s", args->depth); |
| 23 | if (args->threads) |
| 24 | strvec_pushf(&cmd->args, "--threads=%s", args->threads); |
| 25 | if (args->max_pack_size) |
| 26 | strvec_pushf(&cmd->args, "--max-pack-size=%lu", args->max_pack_size); |
| 27 | if (args->no_reuse_delta) |
| 28 | strvec_pushf(&cmd->args, "--no-reuse-delta"); |
| 29 | if (args->no_reuse_object) |
| 30 | strvec_pushf(&cmd->args, "--no-reuse-object"); |
| 31 | if (args->name_hash_version) |
| 32 | strvec_pushf(&cmd->args, "--name-hash-version=%d", args->name_hash_version); |
| 33 | if (args->path_walk) |
| 34 | strvec_pushf(&cmd->args, "--path-walk"); |
| 35 | if (args->local) |
| 36 | strvec_push(&cmd->args, "--local"); |
| 37 | if (args->quiet) |
| 38 | strvec_push(&cmd->args, "--quiet"); |
| 39 | if (args->delta_base_offset) |
| 40 | strvec_push(&cmd->args, "--delta-base-offset"); |
| 41 | if (!args->pack_kept_objects) |
| 42 | strvec_push(&cmd->args, "--honor-pack-keep"); |
| 43 | strvec_push(&cmd->args, out); |
| 44 | cmd->git_cmd = 1; |
| 45 | cmd->out = -1; |
| 46 | } |
| 47 | |
| 48 | void pack_objects_args_release(struct pack_objects_args *args) |
| 49 | { |
no test coverage detected