]> git.ipfire.org Git - thirdparty/git.git/commit
fetch: make filter_options local to cmd_fetch()
authorChristian Couder <christian.couder@gmail.com>
Tue, 23 Dec 2025 11:11:08 +0000 (12:11 +0100)
committerJunio C Hamano <gitster@pobox.com>
Tue, 23 Dec 2025 13:43:05 +0000 (22:43 +0900)
commit6ac467fdbd5519ef94b0615cda2e84cb013c669b
tree9556265ed62e48384a5248e2c9e60d112073988e
parent50cedfdf94ae50205c1a9d782ca6d63f1ec4cba0
fetch: make filter_options local to cmd_fetch()

The `struct list_objects_filter_options filter_options` variable used
in "builtin/fetch.c" to store the parsed filters specified by
`--filter=<filterspec>` is currently a static variable global to the
file.

As we are going to use it more in a following commit, it could become a
bit less easy to understand how it's managed.

To avoid that, let's make it clear that it's owned by cmd_fetch() by
moving its definition into that function and making it non-static.

This requires passing a pointer to it through the prepare_transport(),
do_fetch(), backfill_tags(), fetch_one_setup_partial(), and fetch_one()
functions, but it's quite straightforward.

Signed-off-by: Christian Couder <chriscool@tuxfamily.org>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
builtin/fetch.c