aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJunio C Hamano <gitster@pobox.com>2024-04-01 14:18:05 -0700
committerJunio C Hamano <gitster@pobox.com>2024-04-01 14:18:05 -0700
commit34f00e86432fd3fdf4cdfa3b51d590aa642e8692 (patch)
tree8813cfa84a46e8b357ed8fa54d571e49bcbb125f
parentc2cbfbd2e28cbe27c194d62183b42f27a6a5bb87 (diff)
parent4d45e79e115ef3259179032367cb84d08198c6c5 (diff)
downloadgit-34f00e86432fd3fdf4cdfa3b51d590aa642e8692.tar.gz
Merge branch 'rs/midx-use-strvec-pushf' into tb/midx-write
* rs/midx-use-strvec-pushf: midx: use strvec_pushf() for pack-objects base name
-rw-r--r--midx.c7
1 files changed, 1 insertions, 6 deletions
diff --git a/midx.c b/midx.c
index 85e1c2cd12..41521e019c 100644
--- a/midx.c
+++ b/midx.c
@@ -2163,7 +2163,6 @@ int midx_repack(struct repository *r, const char *object_dir, size_t batch_size,
unsigned char *include_pack;
struct child_process cmd = CHILD_PROCESS_INIT;
FILE *cmd_in;
- struct strbuf base_name = STRBUF_INIT;
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");
- strbuf_addstr(&base_name, object_dir);
- strbuf_addstr(&base_name, "/pack/pack");
- strvec_push(&cmd.args, base_name.buf);
+ strvec_pushf(&cmd.args, "%s/pack/pack", object_dir);
if (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
strvec_push(&cmd.args, "-q");
- strbuf_release(&base_name);
-
cmd.git_cmd = 1;
cmd.in = cmd.out = -1;