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 --- git.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) (limited to 'git.c') diff --git a/git.c b/git.c index 2b212e6675..5a40eab8a2 100644 --- a/git.c +++ b/git.c @@ -877,8 +877,7 @@ static int run_argv(struct strvec *args) commit_pager_choice(); strvec_push(&cmd.args, "git"); - for (size_t i = 0; i < args->nr; i++) - strvec_push(&cmd.args, args->v[i]); + strvec_pushv(&cmd.args, args->v); trace_argv_printf(cmd.args.v, "trace: exec:"); -- cgit v1.3