| 89 | } |
| 90 | |
| 91 | int finish_pack_objects_cmd(const struct git_hash_algo *algop, |
| 92 | const struct write_pack_opts *opts, |
| 93 | struct child_process *cmd, |
| 94 | struct string_list *names) |
| 95 | { |
| 96 | FILE *out; |
| 97 | bool local = write_pack_opts_is_local(opts); |
| 98 | struct strbuf line = STRBUF_INIT; |
| 99 | |
| 100 | out = xfdopen(cmd->out, "r"); |
| 101 | while (strbuf_getline_lf(&line, out) != EOF) { |
| 102 | struct string_list_item *item; |
| 103 | |
| 104 | if (line.len != algop->hexsz) |
| 105 | die(_("repack: Expecting full hex object ID lines only " |
| 106 | "from pack-objects.")); |
| 107 | /* |
| 108 | * Avoid putting packs written outside of the repository in the |
| 109 | * list of names. |
| 110 | */ |
| 111 | if (local) { |
| 112 | item = string_list_append(names, line.buf); |
| 113 | item->util = generated_pack_populate(line.buf, |
| 114 | opts->packtmp); |
| 115 | } |
| 116 | } |
| 117 | fclose(out); |
| 118 | |
| 119 | strbuf_release(&line); |
| 120 | |
| 121 | return finish_command(cmd); |
| 122 | } |
| 123 | |
| 124 | #define DELETE_PACK 1 |
| 125 | #define RETAIN_PACK 2 |
no test coverage detected