config.c: plumb config_source through static fns
commitc97f3ed25611eb816c291ac283be8b7146a8e099
authorGlen Choo <chooglen@google.com>
Tue, 28 Mar 2023 17:51:47 +0000 (28 17:51 +0000)
committerJunio C Hamano <gitster@pobox.com>
Tue, 28 Mar 2023 20:03:26 +0000 (28 13:03 -0700)
treeb428148955ccf86f0361cb9e815a6d161827dde8
parentd15644fe0226af7ffc874572d968598564a230dd
config.c: plumb config_source through static fns

This reduces the direct dependence on the global "struct config_source",
which will make it easier to remove in a later commit.

To minimize the changes we need to make, we rename the current variable
from "cf" to "cf_global", and the plumbed arg uses the old name "cf".
This is a little unfortunate, since we now have the confusingly named
"struct config_source cf" everywhere (which is a holdover from before
4d8dd1494e (config: make parsing stack struct independent from actual
data source, 2013-07-12), when the struct used to be called
"config_file"), but we will rename "cf" to "cs" by the end of the
series.

In some cases (public functions and config callback functions), there
isn't an obvious way to plumb "struct config_source" through function
args. As a workaround, add references to "cf_global" that we'll address
in later commits.

The remaining references to "cf_global" are direct assignments to
"cf_global", which we'll also address in a later commit.

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