aboutsummaryrefslogtreecommitdiff
path: root/git.c
diff options
context:
space:
mode:
authorJunio C Hamano <gitster@pobox.com>2026-03-24 12:26:58 -0700
committerJunio C Hamano <gitster@pobox.com>2026-03-24 12:26:58 -0700
commit250e977a2b0aa8cc1c8063c64c44597a166e79f5 (patch)
tree4bd35c77429ddd78fd53233d41e44b92e02d3e15 /git.c
parent2d733b9660700fa4dd03a89d9003b8865b99bf4d (diff)
downloadgit-250e977a2b0aa8cc1c8063c64c44597a166e79f5.tar.xz
use strvec_pushv() to add another strvec
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 <gitster@pobox.com> Signed-off-by: René Scharfe <l.s.r@web.de> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 'git.c')
-rw-r--r--git.c3
1 files changed, 1 insertions, 2 deletions
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:");