config.c: remove current_config_kvi
commit9828453ff00b330c57daa3a8b672cbb5f0cdce34
authorGlen Choo <chooglen@google.com>
Tue, 28 Mar 2023 17:51:51 +0000 (28 17:51 +0000)
committerJunio C Hamano <gitster@pobox.com>
Tue, 28 Mar 2023 20:03:27 +0000 (28 13:03 -0700)
treef89ac87704ffae762a48f44b9b1b8bf425b630b2
parenta798a56c8aea492a2078c40e16a4a46f3fea5133
config.c: remove current_config_kvi

Add ".config_kvi" to "struct config_reader" and replace
"current_config_kvi" with "the_reader.config_kvi", plumbing "struct
config_reader" where necesssary.

Also, introduce a setter function for ".config_kvi", which allows us to
enforce the contraint that only one of ".source" and ".config_kvi" can
be set at a time (as documented in the comments). Because of this
constraint, we know that "populate_remote_urls()" was never touching
"current_config_kvi" when iterating through config files, so it doesn't
need to store and restore that value.

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