Re: [PATCH 1/3] submodule.c: add has_submodules to check if we have any submodules
- From
Stefan Beller <sbeller@google.com>
- Date
- May 18, 2017, 16:38 UTC
- Message-ID
- <CAGZ79kZZF7L0Wv5kPO+LxM6_7tA=DrD2RSn9SM708yvnxPnW3A@mail.gmail.com>
- In-Reply-To
- <20170518153508.GA112091@google.com>
Show 9 quoted lines
>> +static enum {
>> + SUBMODULE_CONFIG_NOT_READ = 0,
>> + SUBMODULE_CONFIG_NO_CONFIG,
>> + SUBMODULE_CONFIG_EXISTS,
>> +} submodule_config_reading;
>
> Any way we can have this not be a global, but rather a parameter? You
> could pass in a pointer to this value via the callback data parameter in
> the submodule_config function.As said in the reply to Junio, this patch has been sitting on my hard drive for a while and was written before you started the attempt to de-globalize the state of git.
Ideally this setting would be part of the repository object. For example the repository object would have a "submodule_config" pointer, initialized to NULL, which can then be set to the read config or a static empty_config if no such config exists.