Re: [PATCH 1/2] submodule.c: add has_submodules to check if we have any submodules

2017-04-20 Thread Brandon Williams
On 04/20, Stefan Beller wrote: > On Thu, Apr 20, 2017 at 3:07 PM, Brandon Williams wrote: > > On 04/11, Stefan Beller wrote: > >> +int has_submodules(unsigned what_to_check) > >> +{ > >> + if (what_to_check & SUBMODULE_CHECK_ANY_CONFIG) { > >> + if

Re: [PATCH 1/2] submodule.c: add has_submodules to check if we have any submodules

2017-04-20 Thread Stefan Beller
On Thu, Apr 20, 2017 at 3:07 PM, Brandon Williams wrote: > On 04/11, Stefan Beller wrote: >> +int has_submodules(unsigned what_to_check) >> +{ >> + if (what_to_check & SUBMODULE_CHECK_ANY_CONFIG) { >> + if (submodule_config_reading == SUBMODULE_CONFIG_NOT_READ)

Re: [PATCH 1/2] submodule.c: add has_submodules to check if we have any submodules

2017-04-20 Thread Brandon Williams
On 04/11, Stefan Beller wrote: > +int has_submodules(unsigned what_to_check) > +{ > + if (what_to_check & SUBMODULE_CHECK_ANY_CONFIG) { > + if (submodule_config_reading == SUBMODULE_CONFIG_NOT_READ) > + load_submodule_config(); > + if

[PATCH 1/2] submodule.c: add has_submodules to check if we have any submodules

2017-04-11 Thread Stefan Beller
When submodules are involved, it often slows down the process, as most submodule related handling is either done via a child process or by iterating over the index finding all gitlinks. For most commands that may interact with submodules, we need have a quick check if we do have any submodules at