Merge branch 'jt/partial-clone-submodule-1'

Prepare the internals for lazily fetching objects in submodules
from their promisor remotes.

* jt/partial-clone-submodule-1:
  promisor-remote: teach lazy-fetch in any repo
  run-command: refactor subprocess env preparation
  submodule: refrain from filtering GIT_CONFIG_COUNT
  promisor-remote: support per-repository config
  repository: move global r_f_p_c to repo struct
This commit is contained in:
Junio C Hamano
2021-07-16 17:42:53 -07:00
14 changed files with 196 additions and 82 deletions

View File

@ -1891,3 +1891,15 @@ int run_auto_maintenance(int quiet)
return run_command(&maint);
}
void prepare_other_repo_env(struct strvec *env_array, const char *new_git_dir)
{
const char * const *var;
for (var = local_repo_env; *var; var++) {
if (strcmp(*var, CONFIG_DATA_ENVIRONMENT) &&
strcmp(*var, CONFIG_COUNT_ENVIRONMENT))
strvec_push(env_array, *var);
}
strvec_pushf(env_array, "%s=%s", GIT_DIR_ENVIRONMENT, new_git_dir);
}