]> git.ipfire.org Git - thirdparty/git.git/commit
clone: make filter_options local to cmd_clone()
authorChristian Couder <christian.couder@gmail.com>
Tue, 23 Dec 2025 11:11:07 +0000 (12:11 +0100)
committerJunio C Hamano <gitster@pobox.com>
Tue, 23 Dec 2025 13:43:05 +0000 (22:43 +0900)
commit50cedfdf94ae50205c1a9d782ca6d63f1ec4cba0
tree724ab5b395eaa4effd508b62d1c890d355fbfad3
parent09b0cefcd83e94403bf33aa660bd3b51372e4f8d
clone: make filter_options local to cmd_clone()

The `struct list_objects_filter_options filter_options` variable used
in "builtin/clone.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_clone() by
moving its definition into that function and making it non-static.

The only additional change to make this work is to pass it as an
argument to checkout(). So it's a small quite cheap cleanup anyway.

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