108
}
109
110
static int finish_pack_objects_cmd(const struct git_hash_algo *algop,
111
+ const struct write_pack_opts *opts,
112
struct child_process *cmd,
112
- struct string_list *names,
113
- int local)
113
+ struct string_list *names)
114
{
115
FILE *out;
116
+ bool local = write_pack_opts_is_local(opts);
117
struct strbuf line = STRBUF_INIT;
118
119
out = xfdopen(cmd->out, "r");
129
*/
130
if (local) {
131
item = string_list_append(names, line.buf);
131
- item->util = generated_pack_populate(line.buf, packtmp);
132
+ item->util = generated_pack_populate(line.buf,
133
+ opts->packtmp);
134
}
135
}
136
fclose(out);
149
FILE *in;
150
int ret;
151
const char *caret;
150
- bool local = write_pack_opts_is_local(opts);
152
const char *pack_prefix = write_pack_opts_pack_prefix(opts);
153
154
prepare_pack_objects(&cmd, opts->po_args, opts->destination);
184
fprintf(in, "%s%s.pack\n", caret, item->string);
185
fclose(in);
186
186
- return finish_pack_objects_cmd(existing->repo->hash_algo, &cmd, names,
187
- local);
187
+ return finish_pack_objects_cmd(existing->repo->hash_algo, opts, &cmd,
188
+ names);
189
}
190
191
static void combine_small_cruft_packs(FILE *in, size_t combine_cruft_below_size,
232
struct string_list_item *item;
233
FILE *in;
234
int ret;
234
- bool local = write_pack_opts_is_local(opts);
235
const char *pack_prefix = write_pack_opts_pack_prefix(opts);
236
237
prepare_pack_objects(&cmd, opts->po_args, opts->destination);
279
fprintf(in, "%s.pack\n", item->string);
280
fclose(in);
281
282
- return finish_pack_objects_cmd(existing->repo->hash_algo, &cmd, names,
283
- local);
282
+ return finish_pack_objects_cmd(existing->repo->hash_algo, opts, &cmd,
283
+ names);
284
}
285
286
int cmd_repack(int argc,
560
fclose(in);
561
}
562
563
- ret = finish_pack_objects_cmd(repo->hash_algo, &cmd, &names, 1);
564
- if (ret)
565
- goto cleanup;
563
+ {
564
+ struct write_pack_opts opts = {
565
+ .packdir = packdir,
566
+ .destination = packdir,
567
+ .packtmp = packtmp,
568
+ };
569
+ ret = finish_pack_objects_cmd(repo->hash_algo, &opts, &cmd,
570
+ &names);
571
+ if (ret)
572
+ goto cleanup;
573
+ }
574
575
if (!names.nr) {
576
if (!po_args.quiet)