MCPcopy Index your code
hub / github.com/git/git / finish_pack_objects_cmd

Function finish_pack_objects_cmd

repack.c:91–122  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

89}
90
91int 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

Callers 3

write_filtered_packFunction · 0.85
write_cruft_packFunction · 0.85
cmd_repackFunction · 0.85

Calls 8

write_pack_opts_is_localFunction · 0.85
xfdopenFunction · 0.85
strbuf_getline_lfFunction · 0.85
generated_pack_populateFunction · 0.85
strbuf_releaseFunction · 0.85
finish_commandFunction · 0.85
dieFunction · 0.70
string_list_appendFunction · 0.70

Tested by

no test coverage detected