diff options
| author | Junio C Hamano <gitster@pobox.com> | 2026-03-24 12:26:58 -0700 |
|---|---|---|
| committer | Junio C Hamano <gitster@pobox.com> | 2026-03-24 12:26:58 -0700 |
| commit | 250e977a2b0aa8cc1c8063c64c44597a166e79f5 (patch) | |
| tree | 4bd35c77429ddd78fd53233d41e44b92e02d3e15 /fetch-pack.c | |
| parent | 2d733b9660700fa4dd03a89d9003b8865b99bf4d (diff) | |
| download | git-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 'fetch-pack.c')
| -rw-r--r-- | fetch-pack.c | 8 |
1 files changed, 2 insertions, 6 deletions
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); |
