aboutsummaryrefslogtreecommitdiff
path: root/submodule.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 /submodule.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 'submodule.c')
-rw-r--r--submodule.c4
1 files changed, 1 insertions, 3 deletions
diff --git a/submodule.c b/submodule.c
index cd879a5cfe..4c8c674aa4 100644
--- a/submodule.c
+++ b/submodule.c
@@ -1815,7 +1815,6 @@ int fetch_submodules(struct repository *r,
int default_option,
int quiet, int max_parallel_jobs)
{
- int i;
struct submodule_parallel_fetch spf = SPF_INIT;
const struct run_process_parallel_opts opts = {
.tr2_category = "submodule",
@@ -1842,8 +1841,7 @@ int fetch_submodules(struct repository *r,
die(_("index file corrupt"));
strvec_push(&spf.args, "fetch");
- for (i = 0; i < options->nr; i++)
- strvec_push(&spf.args, options->v[i]);
+ strvec_pushv(&spf.args, options->v);
strvec_push(&spf.args, "--recurse-submodules-default");
/* default value, "--submodule-prefix" and its value are added later */