Skip to content

Commit 34f00e8

Browse files
committed
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
2 parents c2cbfbd + 4d45e79 commit 34f00e8

File tree

1 file changed

+1
-6
lines changed

1 file changed

+1
-6
lines changed

midx.c

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -2163,7 +2163,6 @@ int midx_repack(struct repository *r, const char *object_dir, size_t batch_size,
21632163
unsigned char *include_pack;
21642164
struct child_process cmd = CHILD_PROCESS_INIT;
21652165
FILE *cmd_in;
2166-
struct strbuf base_name = STRBUF_INIT;
21672166
struct multi_pack_index *m = lookup_multi_pack_index(r, object_dir);
21682167

21692168
/*
@@ -2190,9 +2189,7 @@ int midx_repack(struct repository *r, const char *object_dir, size_t batch_size,
21902189

21912190
strvec_push(&cmd.args, "pack-objects");
21922191

2193-
strbuf_addstr(&base_name, object_dir);
2194-
strbuf_addstr(&base_name, "/pack/pack");
2195-
strvec_push(&cmd.args, base_name.buf);
2192+
strvec_pushf(&cmd.args, "%s/pack/pack", object_dir);
21962193

21972194
if (delta_base_offset)
21982195
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,
22042201
else
22052202
strvec_push(&cmd.args, "-q");
22062203

2207-
strbuf_release(&base_name);
2208-
22092204
cmd.git_cmd = 1;
22102205
cmd.in = cmd.out = -1;
22112206

0 commit comments

Comments
 (0)