From 250e977a2b0aa8cc1c8063c64c44597a166e79f5 Mon Sep 17 00:00:00 2001 From: Junio C Hamano Date: Tue, 24 Mar 2026 12:26:58 -0700 Subject: use strvec_pushv() to add another strvec MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Add and apply a semantic patch that simplifies the code by letting strvec_pushv() append the items of a second strvec instead of pushing them one by one. Suggested-by: Junio C Hamano Signed-off-by: René Scharfe Signed-off-by: Junio C Hamano --- fetch-pack.c | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) (limited to 'fetch-pack.c') diff --git a/fetch-pack.c b/fetch-pack.c index 6ecd468ef7..a32224ed02 100644 --- a/fetch-pack.c +++ b/fetch-pack.c @@ -1024,12 +1024,8 @@ static int get_pack(struct fetch_pack_args *args, fsck_msg_types.buf); } - if (index_pack_args) { - int i; - - for (i = 0; i < cmd.args.nr; i++) - strvec_push(index_pack_args, cmd.args.v[i]); - } + if (index_pack_args) + strvec_pushv(index_pack_args, cmd.args.v); sigchain_push(SIGPIPE, SIG_IGN); -- cgit v1.3