summaryrefslogtreecommitdiff
path: root/submodule.c
diff options
context:
space:
mode:
authorJunio C Hamano <gitster@pobox.com>2022-06-10 22:04:13 (GMT)
committerJunio C Hamano <gitster@pobox.com>2022-06-10 22:04:13 (GMT)
commitc21fa3bb549a7769f9d508f0a5f95c654539e1f7 (patch)
treeb6998d52e7a03a0aff33d2cdce53a23bfa553996 /submodule.c
parent597553e42e816b58cad857d759f11c5f53a01510 (diff)
parentb3193252c4278e9039fbb896a35f84abc1fb5aac (diff)
downloadgit-c21fa3bb549a7769f9d508f0a5f95c654539e1f7.zip
git-c21fa3bb549a7769f9d508f0a5f95c654539e1f7.tar.gz
git-c21fa3bb549a7769f9d508f0a5f95c654539e1f7.tar.bz2
Merge branch 'ab/env-array'
Rename .env_array member to .env in the child_process structure. * ab/env-array: run-command API users: use "env" not "env_array" in comments & names run-command API: rename "env_array" to "env"
Diffstat (limited to 'submodule.c')
-rw-r--r--submodule.c38
1 files changed, 19 insertions, 19 deletions
diff --git a/submodule.c b/submodule.c
index 7923e95..4e299f5 100644
--- a/submodule.c
+++ b/submodule.c
@@ -711,15 +711,15 @@ void show_submodule_inline_diff(struct diff_options *o, const char *path,
if (!(dirty_submodule & DIRTY_SUBMODULE_MODIFIED))
strvec_push(&cp.args, oid_to_hex(new_oid));
- prepare_submodule_repo_env(&cp.env_array);
+ prepare_submodule_repo_env(&cp.env);
if (!is_directory(path)) {
/* fall back to absorbed git dir, if any */
if (!sub)
goto done;
cp.dir = sub->gitdir;
- strvec_push(&cp.env_array, GIT_DIR_ENVIRONMENT "=.");
- strvec_push(&cp.env_array, GIT_WORK_TREE_ENVIRONMENT "=.");
+ strvec_push(&cp.env, GIT_DIR_ENVIRONMENT "=.");
+ strvec_push(&cp.env, GIT_WORK_TREE_ENVIRONMENT "=.");
}
if (start_command(&cp)) {
@@ -1020,7 +1020,7 @@ static int submodule_has_commits(struct repository *r,
oid_array_for_each_unique(commits, append_oid_to_argv, &cp.args);
strvec_pushl(&cp.args, "--not", "--all", NULL);
- prepare_submodule_repo_env(&cp.env_array);
+ prepare_submodule_repo_env(&cp.env);
cp.git_cmd = 1;
cp.no_stdin = 1;
cp.dir = path;
@@ -1061,7 +1061,7 @@ static int submodule_needs_pushing(struct repository *r,
oid_array_for_each_unique(commits, append_oid_to_argv, &cp.args);
strvec_pushl(&cp.args, "--not", "--remotes", "-n", "1" , NULL);
- prepare_submodule_repo_env(&cp.env_array);
+ prepare_submodule_repo_env(&cp.env);
cp.git_cmd = 1;
cp.no_stdin = 1;
cp.out = -1;
@@ -1147,7 +1147,7 @@ static int push_submodule(const char *path,
strvec_push(&cp.args, rs->raw[i]);
}
- prepare_submodule_repo_env(&cp.env_array);
+ prepare_submodule_repo_env(&cp.env);
cp.git_cmd = 1;
cp.no_stdin = 1;
cp.dir = path;
@@ -1178,7 +1178,7 @@ static void submodule_push_check(const char *path, const char *head,
for (i = 0; i < rs->raw_nr; i++)
strvec_push(&cp.args, rs->raw[i]);
- prepare_submodule_repo_env(&cp.env_array);
+ prepare_submodule_repo_env(&cp.env);
cp.git_cmd = 1;
cp.no_stdin = 1;
cp.no_stdout = 1;
@@ -1679,7 +1679,7 @@ static int get_next_submodule(struct child_process *cp, struct strbuf *err,
child_process_init(cp);
cp->dir = task->repo->gitdir;
- prepare_submodule_repo_env_in_gitdir(&cp->env_array);
+ prepare_submodule_repo_env_in_gitdir(&cp->env);
cp->git_cmd = 1;
strvec_init(&cp->args);
if (task->git_args.nr)
@@ -1709,7 +1709,7 @@ static int get_next_submodule(struct child_process *cp, struct strbuf *err,
spf->prefix, task->sub->path);
child_process_init(cp);
- prepare_submodule_repo_env_in_gitdir(&cp->env_array);
+ prepare_submodule_repo_env_in_gitdir(&cp->env);
cp->git_cmd = 1;
cp->dir = task->repo->gitdir;
@@ -1883,7 +1883,7 @@ unsigned is_submodule_modified(const char *path, int ignore_untracked)
if (ignore_untracked)
strvec_push(&cp.args, "-uno");
- prepare_submodule_repo_env(&cp.env_array);
+ prepare_submodule_repo_env(&cp.env);
cp.git_cmd = 1;
cp.no_stdin = 1;
cp.out = -1;
@@ -1955,7 +1955,7 @@ int submodule_uses_gitfile(const char *path)
"submodule", "foreach", "--quiet", "--recursive",
"test -f .git", NULL);
- prepare_submodule_repo_env(&cp.env_array);
+ prepare_submodule_repo_env(&cp.env);
cp.git_cmd = 1;
cp.no_stdin = 1;
cp.no_stderr = 1;
@@ -1998,7 +1998,7 @@ int bad_to_remove_submodule(const char *path, unsigned flags)
if (!(flags & SUBMODULE_REMOVAL_IGNORE_IGNORED_UNTRACKED))
strvec_push(&cp.args, "--ignored");
- prepare_submodule_repo_env(&cp.env_array);
+ prepare_submodule_repo_env(&cp.env);
cp.git_cmd = 1;
cp.no_stdin = 1;
cp.out = -1;
@@ -2053,7 +2053,7 @@ static int submodule_has_dirty_index(const struct submodule *sub)
{
struct child_process cp = CHILD_PROCESS_INIT;
- prepare_submodule_repo_env(&cp.env_array);
+ prepare_submodule_repo_env(&cp.env);
cp.git_cmd = 1;
strvec_pushl(&cp.args, "diff-index", "--quiet",
@@ -2070,7 +2070,7 @@ static int submodule_has_dirty_index(const struct submodule *sub)
static void submodule_reset_index(const char *path)
{
struct child_process cp = CHILD_PROCESS_INIT;
- prepare_submodule_repo_env(&cp.env_array);
+ prepare_submodule_repo_env(&cp.env);
cp.git_cmd = 1;
cp.no_stdin = 1;
@@ -2154,7 +2154,7 @@ int submodule_move_head(const char *path,
}
}
- prepare_submodule_repo_env(&cp.env_array);
+ prepare_submodule_repo_env(&cp.env);
cp.git_cmd = 1;
cp.no_stdin = 1;
@@ -2192,7 +2192,7 @@ int submodule_move_head(const char *path,
cp.no_stdin = 1;
cp.dir = path;
- prepare_submodule_repo_env(&cp.env_array);
+ prepare_submodule_repo_env(&cp.env);
strvec_pushl(&cp.args, "update-ref", "HEAD",
"--no-deref", new_head, NULL);
@@ -2375,7 +2375,7 @@ void absorb_git_dir_into_superproject(const char *path,
strvec_pushl(&cp.args, "--super-prefix", sb.buf,
"submodule--helper",
"absorb-git-dirs", NULL);
- prepare_submodule_repo_env(&cp.env_array);
+ prepare_submodule_repo_env(&cp.env);
if (run_command(&cp))
die(_("could not recurse into submodule '%s'"), path);
@@ -2408,8 +2408,8 @@ int get_superproject_working_tree(struct strbuf *buf)
subpath = relative_path(cwd, one_up.buf, &sb);
strbuf_release(&one_up);
- prepare_submodule_repo_env(&cp.env_array);
- strvec_pop(&cp.env_array);
+ prepare_submodule_repo_env(&cp.env);
+ strvec_pop(&cp.env);
strvec_pushl(&cp.args, "--literal-pathspecs", "-C", "..",
"ls-files", "-z", "--stage", "--full-name", "--",