Show 36 quoted lines
> Ævar Arnfjörð Bjarmason <avarab@gmail.com> writes:
>
>> As with a preceding commit to convert "absorbgitdirs", we can convert
>> "submodule--helper foreach" to use its own "--super-prefix", instead
>> of relying on the global "--super-prefix" argument to "git"
>> itself. See that earlier commit for the rationale and background.
>>
>> Signed-off-by: Ævar Arnfjörð Bjarmason <avarab@gmail.com>
>> ---
>> builtin/submodule--helper.c | 15 ++++++++++-----
>> 1 file changed, 10 insertions(+), 5 deletions(-)
>>
>> diff --git a/builtin/submodule--helper.c b/builtin/submodule--helper.c
>> index c4d5e029b37..989c75280af 100644
>> --- a/builtin/submodule--helper.c
>> +++ b/builtin/submodule--helper.c
>> @@ -396,7 +398,9 @@ static int module_foreach(int argc, const char **argv, const char *prefix)
>> struct foreach_cb info = FOREACH_CB_INIT;
>> struct pathspec pathspec = { 0 };
>> struct module_list list = MODULE_LIST_INIT;
>> + const char *super_prefix = NULL;
>> struct option module_foreach_options[] = {
>> + OPT__SUPER_PREFIX(&super_prefix),
>> OPT__QUIET(&info.quiet, N_("suppress output of entering each submodule command")),
>> OPT_BOOL(0, "recursive", &info.recursive,
>> N_("recurse into nested submodules")),
>> @@ -417,6 +421,7 @@ static int module_foreach(int argc, const char **argv, const char *prefix)
>> info.argc = argc;
>> info.argv = argv;
>> info.prefix = prefix;
>> + info.super_prefix = super_prefix;
>
> (Also applies to subsequent patches) Why don't we assign the super
> prefix directly to the struct's field? e.g.
>
> OPT__SUPER_PREFIX(&info.super_prefix),