]> Kevux Git Server - rit/commit
clone: make filter_options local to cmd_clone()
authorChristian Couder <christian.couder@gmail.com>
Mon, 16 Feb 2026 13:23:09 +0000 (14:23 +0100)
committerJunio C Hamano <gitster@pobox.com>
Tue, 17 Feb 2026 19:46:40 +0000 (11:46 -0800)
commitfe5335974323da5e829676735cc32d89422d58ba
tree255203def73b8100fe409d83519ddcd2fea1acb7
parent3e20258d11f188189c18bb6c4f2b2eee47abf03d
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