1
0
Fork 0
mirror of https://github.com/git/git.git synced 2024-05-12 22:16:13 +02:00

Merge branch 'rs/midx-use-strvec-pushf' into next

Code clean-up.

* rs/midx-use-strvec-pushf:
  midx: use strvec_pushf() for pack-objects base name
This commit is contained in:
Junio C Hamano 2024-03-27 10:13:04 -07:00
commit 16969df3e8

7
midx.c
View File

@ -2163,7 +2163,6 @@ int midx_repack(struct repository *r, const char *object_dir, size_t batch_size,
unsigned char *include_pack; unsigned char *include_pack;
struct child_process cmd = CHILD_PROCESS_INIT; struct child_process cmd = CHILD_PROCESS_INIT;
FILE *cmd_in; FILE *cmd_in;
struct strbuf base_name = STRBUF_INIT;
struct multi_pack_index *m = lookup_multi_pack_index(r, object_dir); struct multi_pack_index *m = lookup_multi_pack_index(r, object_dir);
/* /*
@ -2190,9 +2189,7 @@ int midx_repack(struct repository *r, const char *object_dir, size_t batch_size,
strvec_push(&cmd.args, "pack-objects"); strvec_push(&cmd.args, "pack-objects");
strbuf_addstr(&base_name, object_dir); strvec_pushf(&cmd.args, "%s/pack/pack", object_dir);
strbuf_addstr(&base_name, "/pack/pack");
strvec_push(&cmd.args, base_name.buf);
if (delta_base_offset) if (delta_base_offset)
strvec_push(&cmd.args, "--delta-base-offset"); strvec_push(&cmd.args, "--delta-base-offset");
@ -2204,8 +2201,6 @@ int midx_repack(struct repository *r, const char *object_dir, size_t batch_size,
else else
strvec_push(&cmd.args, "-q"); strvec_push(&cmd.args, "-q");
strbuf_release(&base_name);
cmd.git_cmd = 1; cmd.git_cmd = 1;
cmd.in = cmd.out = -1; cmd.in = cmd.out = -1;