config.c: remove current_parsing_scope
commit5cdf18e7cd6d6e3ce2fb21fef2b5ec84e570abf8
authorGlen Choo <chooglen@google.com>
Tue, 28 Mar 2023 17:51:52 +0000 (28 17:51 +0000)
committerJunio C Hamano <gitster@pobox.com>
Tue, 28 Mar 2023 20:03:27 +0000 (28 13:03 -0700)
tree815eb3777ff2ab2965d24daae130da63bb438b01
parent9828453ff00b330c57daa3a8b672cbb5f0cdce34
config.c: remove current_parsing_scope

Add ".parsing_scope" to "struct config_reader" and replace
"current_parsing_scope" with "the_reader.parsing_scope. Adjust the
comment slightly to make it clearer that the scope applies to the config
source (not the current value), and should only be set when parsing a
config source.

As such, ".parsing_scope" (only set when parsing config sources) and
".config_kvi" (only set when iterating a config set) should not be
set together, so enforce this with a setter function.

Unlike previous commits, "populate_remote_urls()" still needs to store
and restore the 'scope' value because it could have touched
"current_parsing_scope" ("config_with_options()" can set the scope).

Signed-off-by: Glen Choo <chooglen@google.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
config.c