Merge branch 'bw/grep-recurse-submodules'
"git grep --recurse-submodules" has been reworked to give a more consistent output across submodule boundary (and do its thing without having to fork a separate process). * bw/grep-recurse-submodules: grep: recurse in-process using 'struct repository' submodule: merge repo_read_gitmodules and gitmodules_config submodule: check for unmerged .gitmodules outside of config parsing submodule: check for unstaged .gitmodules outside of config parsing submodule: remove fetch.recursesubmodules from submodule-config parsing submodule: remove submodule.fetchjobs from submodule-config parsing config: add config_from_gitmodules cache.h: add GITMODULES_FILE macro repository: have the_repository use the_index repo_read_index: don't discard the index
This commit is contained in:
@ -960,10 +960,19 @@ static int update_clone_task_finished(int result,
|
||||
return 0;
|
||||
}
|
||||
|
||||
static int gitmodules_update_clone_config(const char *var, const char *value,
|
||||
void *cb)
|
||||
{
|
||||
int *max_jobs = cb;
|
||||
if (!strcmp(var, "submodule.fetchjobs"))
|
||||
*max_jobs = parse_submodule_fetchjobs(var, value);
|
||||
return 0;
|
||||
}
|
||||
|
||||
static int update_clone(int argc, const char **argv, const char *prefix)
|
||||
{
|
||||
const char *update = NULL;
|
||||
int max_jobs = -1;
|
||||
int max_jobs = 1;
|
||||
struct string_list_item *item;
|
||||
struct pathspec pathspec;
|
||||
struct submodule_update_clone suc = SUBMODULE_UPDATE_CLONE_INIT;
|
||||
@ -1000,6 +1009,9 @@ static int update_clone(int argc, const char **argv, const char *prefix)
|
||||
};
|
||||
suc.prefix = prefix;
|
||||
|
||||
config_from_gitmodules(gitmodules_update_clone_config, &max_jobs);
|
||||
git_config(gitmodules_update_clone_config, &max_jobs);
|
||||
|
||||
argc = parse_options(argc, argv, prefix, module_update_clone_options,
|
||||
git_submodule_helper_usage, 0);
|
||||
|
||||
@ -1017,9 +1029,6 @@ static int update_clone(int argc, const char **argv, const char *prefix)
|
||||
gitmodules_config();
|
||||
git_config(submodule_config, NULL);
|
||||
|
||||
if (max_jobs < 0)
|
||||
max_jobs = parallel_submodules();
|
||||
|
||||
run_processes_parallel(max_jobs,
|
||||
update_clone_get_next_task,
|
||||
update_clone_start_failure,
|
||||
|
Reference in New Issue
Block a user