va_end(ap);
cp->git_cmd = 1;
- strvec_pushf(&cp->env_array,
+ strvec_pushf(&cp->env,
INDEX_ENVIRONMENT "=%s", s->s.r->index_file);
}
child.err = -1;
child.stdout_to_stderr = 1;
- prepare_other_repo_env(&child.env_array, r->gitdir);
+ prepare_other_repo_env(&child.env, r->gitdir);
/*
* submodule_create_branch() is indirectly invoked by "git
* branch", but we cannot invoke "git branch" in the child
update_index.use_shell = 0;
update_index.clean_on_exit = 1;
update_index.dir = workdir;
- strvec_pushf(&update_index.env_array, "GIT_INDEX_FILE=%s", index_path);
+ strvec_pushf(&update_index.env, "GIT_INDEX_FILE=%s", index_path);
/* Ignore any errors of update-index */
run_command(&update_index);
diff_files.clean_on_exit = 1;
diff_files.out = -1;
diff_files.dir = workdir;
- strvec_pushf(&diff_files.env_array, "GIT_INDEX_FILE=%s", index_path);
+ strvec_pushf(&diff_files.env, "GIT_INDEX_FILE=%s", index_path);
if (start_command(&diff_files))
die("could not obtain raw diff");
fp = xfdopen(diff_files.out, "r");
child->git_cmd = 1;
child->dir = prefix;
- strvec_pushv(&child->env_array, env);
+ strvec_pushv(&child->env, env);
return run_command(child);
}
nonce_status = check_nonce(push_cert.buf, bogs);
}
if (!is_null_oid(&push_cert_oid)) {
- strvec_pushf(&proc->env_array, "GIT_PUSH_CERT=%s",
+ strvec_pushf(&proc->env, "GIT_PUSH_CERT=%s",
oid_to_hex(&push_cert_oid));
- strvec_pushf(&proc->env_array, "GIT_PUSH_CERT_SIGNER=%s",
+ strvec_pushf(&proc->env, "GIT_PUSH_CERT_SIGNER=%s",
sigcheck.signer ? sigcheck.signer : "");
- strvec_pushf(&proc->env_array, "GIT_PUSH_CERT_KEY=%s",
+ strvec_pushf(&proc->env, "GIT_PUSH_CERT_KEY=%s",
sigcheck.key ? sigcheck.key : "");
- strvec_pushf(&proc->env_array, "GIT_PUSH_CERT_STATUS=%c",
+ strvec_pushf(&proc->env, "GIT_PUSH_CERT_STATUS=%c",
sigcheck.result);
if (push_cert_nonce) {
- strvec_pushf(&proc->env_array,
+ strvec_pushf(&proc->env,
"GIT_PUSH_CERT_NONCE=%s",
push_cert_nonce);
- strvec_pushf(&proc->env_array,
+ strvec_pushf(&proc->env,
"GIT_PUSH_CERT_NONCE_STATUS=%s",
nonce_status);
if (nonce_status == NONCE_SLOP)
- strvec_pushf(&proc->env_array,
+ strvec_pushf(&proc->env,
"GIT_PUSH_CERT_NONCE_SLOP=%ld",
nonce_stamp_slop);
}
if (feed_state->push_options) {
size_t i;
for (i = 0; i < feed_state->push_options->nr; i++)
- strvec_pushf(&proc.env_array,
+ strvec_pushf(&proc.env,
"GIT_PUSH_OPTION_%"PRIuMAX"=%s",
(uintmax_t)i,
feed_state->push_options->items[i].string);
- strvec_pushf(&proc.env_array, "GIT_PUSH_OPTION_COUNT=%"PRIuMAX"",
+ strvec_pushf(&proc.env, "GIT_PUSH_OPTION_COUNT=%"PRIuMAX"",
(uintmax_t)feed_state->push_options->nr);
} else
- strvec_pushf(&proc.env_array, "GIT_PUSH_OPTION_COUNT");
+ strvec_pushf(&proc.env, "GIT_PUSH_OPTION_COUNT");
if (tmp_objdir)
- strvec_pushv(&proc.env_array, tmp_objdir_env(tmp_objdir));
+ strvec_pushv(&proc.env, tmp_objdir_env(tmp_objdir));
if (use_sideband) {
memset(&muxer, 0, sizeof(muxer));
strvec_pushl(&child.args, "update-index", "-q", "--ignore-submodules",
"--refresh", NULL);
- strvec_pushv(&child.env_array, env->v);
+ strvec_pushv(&child.env, env->v);
child.dir = work_tree;
child.no_stdin = 1;
child.stdout_to_stderr = 1;
child_process_init(&child);
strvec_pushl(&child.args, "diff-files", "--quiet",
"--ignore-submodules", "--", NULL);
- strvec_pushv(&child.env_array, env->v);
+ strvec_pushv(&child.env, env->v);
child.dir = work_tree;
child.no_stdin = 1;
child.stdout_to_stderr = 1;
/* diff-index with either HEAD or an empty tree */
head_has_history() ? "HEAD" : empty_tree_oid_hex(),
"--", NULL);
- strvec_pushv(&child.env_array, env->v);
+ strvec_pushv(&child.env, env->v);
child.no_stdin = 1;
child.no_stdout = 1;
child.stdout_to_stderr = 0;
child_process_init(&child);
strvec_pushl(&child.args, "read-tree", "-u", "-m", hash_to_hex(sha1),
NULL);
- strvec_pushv(&child.env_array, env->v);
+ strvec_pushv(&child.env, env->v);
child.dir = work_tree;
child.no_stdin = 1;
child.no_stdout = 1;
return "unable to create temporary object directory";
}
if (tmp_objdir)
- strvec_pushv(&child.env_array, tmp_objdir_env(tmp_objdir));
+ strvec_pushv(&child.env, tmp_objdir_env(tmp_objdir));
/*
* Normally we just pass the tmp_objdir environment to the child
cp.git_cmd = 1;
strvec_push(&cp.args, "read-tree");
strvec_push(&cp.args, oid_to_hex(u_tree));
- strvec_pushf(&cp.env_array, "GIT_INDEX_FILE=%s",
+ strvec_pushf(&cp.env, "GIT_INDEX_FILE=%s",
stash_index_path.buf);
if (run_command(&cp)) {
remove_path(stash_index_path.buf);
child_process_init(&cp);
cp.git_cmd = 1;
strvec_pushl(&cp.args, "checkout-index", "--all", NULL);
- strvec_pushf(&cp.env_array, "GIT_INDEX_FILE=%s",
+ strvec_pushf(&cp.env, "GIT_INDEX_FILE=%s",
stash_index_path.buf);
res = run_command(&cp);
*/
cp.git_cmd = 1;
cp.dir = prefix;
- strvec_pushf(&cp.env_array, GIT_WORK_TREE_ENVIRONMENT"=%s",
+ strvec_pushf(&cp.env, GIT_WORK_TREE_ENVIRONMENT"=%s",
absolute_path(get_git_work_tree()));
- strvec_pushf(&cp.env_array, GIT_DIR_ENVIRONMENT"=%s",
+ strvec_pushf(&cp.env, GIT_DIR_ENVIRONMENT"=%s",
absolute_path(get_git_dir()));
strvec_push(&cp.args, "status");
run_command(&cp);
cp_upd_index.git_cmd = 1;
strvec_pushl(&cp_upd_index.args, "update-index", "-z", "--add",
"--remove", "--stdin", NULL);
- strvec_pushf(&cp_upd_index.env_array, "GIT_INDEX_FILE=%s",
+ strvec_pushf(&cp_upd_index.env, "GIT_INDEX_FILE=%s",
stash_index_path.buf);
strbuf_addf(&untracked_msg, "untracked files on %s\n", msg->buf);
cp_read_tree.git_cmd = 1;
strvec_pushl(&cp_read_tree.args, "read-tree", "HEAD", NULL);
- strvec_pushf(&cp_read_tree.env_array, "GIT_INDEX_FILE=%s",
+ strvec_pushf(&cp_read_tree.env, "GIT_INDEX_FILE=%s",
stash_index_path.buf);
if (run_command(&cp_read_tree)) {
ret = -1;
strvec_pushl(&cp_upd_index.args, "update-index",
"--ignore-skip-worktree-entries",
"-z", "--add", "--remove", "--stdin", NULL);
- strvec_pushf(&cp_upd_index.env_array, "GIT_INDEX_FILE=%s",
+ strvec_pushf(&cp_upd_index.env, "GIT_INDEX_FILE=%s",
stash_index_path.buf);
if (pipe_command(&cp_upd_index, diff_output.buf, diff_output.len,
cp.git_cmd = 1;
if (startup_info->original_cwd) {
cp.dir = startup_info->original_cwd;
- strvec_pushf(&cp.env_array, "%s=%s",
+ strvec_pushf(&cp.env, "%s=%s",
GIT_WORK_TREE_ENVIRONMENT,
the_repository->worktree);
}
for (d = describe_argv; *d; d++) {
struct child_process cp = CHILD_PROCESS_INIT;
- prepare_submodule_repo_env(&cp.env_array);
+ prepare_submodule_repo_env(&cp.env);
cp.dir = sub_path;
cp.git_cmd = 1;
cp.no_stderr = 1;
if (!is_submodule_populated_gently(path, NULL))
goto cleanup;
- prepare_submodule_repo_env(&cp.env_array);
+ prepare_submodule_repo_env(&cp.env);
/*
* For the purpose of executing <command> in the submodule,
char *toplevel = xgetcwd();
struct strbuf sb = STRBUF_INIT;
- strvec_pushf(&cp.env_array, "name=%s", sub->name);
- strvec_pushf(&cp.env_array, "sm_path=%s", path);
- strvec_pushf(&cp.env_array, "displaypath=%s", displaypath);
- strvec_pushf(&cp.env_array, "sha1=%s",
+ strvec_pushf(&cp.env, "name=%s", sub->name);
+ strvec_pushf(&cp.env, "sm_path=%s", path);
+ strvec_pushf(&cp.env, "displaypath=%s", displaypath);
+ strvec_pushf(&cp.env, "sha1=%s",
oid_to_hex(ce_oid));
- strvec_pushf(&cp.env_array, "toplevel=%s", toplevel);
+ strvec_pushf(&cp.env, "toplevel=%s", toplevel);
/*
* Since the path variable was accessible from the script
cpr.git_cmd = 1;
cpr.dir = path;
- prepare_submodule_repo_env(&cpr.env_array);
+ prepare_submodule_repo_env(&cpr.env);
strvec_pushl(&cpr.args, "--super-prefix", NULL);
strvec_pushf(&cpr.args, "%s/", displaypath);
cpr.git_cmd = 1;
cpr.dir = path;
- prepare_submodule_repo_env(&cpr.env_array);
+ prepare_submodule_repo_env(&cpr.env);
strvec_push(&cpr.args, "--super-prefix");
strvec_pushf(&cpr.args, "%s/", displaypath);
cp_rev_parse.git_cmd = 1;
cp_rev_parse.dir = sm_path;
- prepare_submodule_repo_env(&cp_rev_parse.env_array);
+ prepare_submodule_repo_env(&cp_rev_parse.env);
strvec_pushl(&cp_rev_parse.args, "rev-parse", "-q", "--short", NULL);
strvec_pushf(&cp_rev_parse.args, "%s^0", committish);
strvec_push(&cp_rev_parse.args, "--");
cp_log.git_cmd = 1;
cp_log.dir = p->sm_path;
- prepare_submodule_repo_env(&cp_log.env_array);
+ prepare_submodule_repo_env(&cp_log.env);
strvec_pushl(&cp_log.args, "log", NULL);
if (S_ISGITLINK(p->mod_src) && S_ISGITLINK(p->mod_dst)) {
cp_rev_list.git_cmd = 1;
cp_rev_list.dir = p->sm_path;
- prepare_submodule_repo_env(&cp_rev_list.env_array);
+ prepare_submodule_repo_env(&cp_rev_list.env);
if (!capture_command(&cp_rev_list, &sb_rev_list, 0))
total_commits = atoi(sb_rev_list.buf);
cpr.git_cmd = 1;
cpr.dir = path;
- prepare_submodule_repo_env(&cpr.env_array);
+ prepare_submodule_repo_env(&cpr.env);
strvec_push(&cpr.args, "--super-prefix");
strvec_pushf(&cpr.args, "%s/", displaypath);
strvec_push(&cp.args, clone_data->path);
cp.git_cmd = 1;
- prepare_submodule_repo_env(&cp.env_array);
+ prepare_submodule_repo_env(&cp.env);
cp.no_stdin = 1;
if(run_command(&cp))
cp.no_stderr = 1;
strvec_pushl(&cp.args, "rev-list", "-n", "1", hex, "--not", "--all", NULL);
- prepare_submodule_repo_env(&cp.env_array);
+ prepare_submodule_repo_env(&cp.env);
if (capture_command(&cp, &rev, GIT_MAX_HEXSZ + 1) || rev.len)
return 0;
{
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.dir = xstrdup(module_path);
strvec_push(&cp.args, oid);
cp.dir = xstrdup(ud->sm_path);
- prepare_submodule_repo_env(&cp.env_array);
+ prepare_submodule_repo_env(&cp.env);
if (run_command(&cp)) {
switch (ud->update_strategy.type) {
case SM_UPDATE_CHECKOUT:
cp.dir = update_data->sm_path;
cp.git_cmd = 1;
- prepare_submodule_repo_env(&cp.env_array);
+ prepare_submodule_repo_env(&cp.env);
update_data_to_args(&next, &cp.args);
/* die() if child process die()'d */
struct strbuf sb_remote_out = STRBUF_INIT;
cp_remote.git_cmd = 1;
- strvec_pushf(&cp_remote.env_array,
+ strvec_pushf(&cp_remote.env,
"GIT_DIR=%s", git_dir_path);
- strvec_push(&cp_remote.env_array, "GIT_WORK_TREE=.");
+ strvec_push(&cp_remote.env, "GIT_WORK_TREE=.");
strvec_pushl(&cp_remote.args, "remote", "-v", NULL);
if (!capture_command(&cp_remote, &sb_remote_out, 0)) {
char *next_line;
if (clone_submodule(&clone_data))
return -1;
- prepare_submodule_repo_env(&cp.env_array);
+ prepare_submodule_repo_env(&cp.env);
cp.git_cmd = 1;
cp.dir = add_data->sm_path;
/*
strvec_pushl(&cp.args, "reset", "--hard", "--no-recurse-submodules", NULL);
if (opts->quiet)
strvec_push(&cp.args, "--quiet");
- strvec_pushv(&cp.env_array, child_env->v);
+ strvec_pushv(&cp.env, child_env->v);
return run_command(&cp);
}
strvec_push(&cp.args, "--quiet");
}
- strvec_pushv(&cp.env_array, child_env.v);
+ strvec_pushv(&cp.env, child_env.v);
ret = run_command(&cp);
if (ret)
goto done;
validate_no_submodules(wt);
child_process_init(&cp);
- strvec_pushf(&cp.env_array, "%s=%s/.git",
+ strvec_pushf(&cp.env, "%s=%s/.git",
GIT_DIR_ENVIRONMENT, wt->path);
- strvec_pushf(&cp.env_array, "%s=%s",
+ strvec_pushf(&cp.env, "%s=%s",
GIT_WORK_TREE_ENVIRONMENT, wt->path);
strvec_pushl(&cp.args, "status",
"--porcelain", "--ignore-submodules=none",
strvec_push(&detect.args, ssh);
strvec_push(&detect.args, "-G");
- push_ssh_options(&detect.args, &detect.env_array,
+ push_ssh_options(&detect.args, &detect.env,
VARIANT_SSH, port, version, flags);
strvec_push(&detect.args, ssh_host);
}
strvec_push(&conn->args, ssh);
- push_ssh_options(&conn->args, &conn->env_array, variant, port, version, flags);
+ push_ssh_options(&conn->args, &conn->env, variant, port, version,
+ flags);
strvec_push(&conn->args, ssh_host);
}
/* remove repo-local variables from the environment */
for (var = local_repo_env; *var; var++)
- strvec_push(&conn->env_array, *var);
+ strvec_push(&conn->env, *var);
conn->use_shell = 1;
conn->in = conn->out = -1;
transport_check_allowed("file");
conn->trace2_child_class = "transport/file";
if (version > 0) {
- strvec_pushf(&conn->env_array,
+ strvec_pushf(&conn->env,
GIT_PROTOCOL_ENVIRONMENT "=version=%d",
version);
}
rev_list.git_cmd = 1;
if (opt->env)
- strvec_pushv(&rev_list.env_array, opt->env);
+ strvec_pushv(&rev_list.env, opt->env);
rev_list.in = -1;
rev_list.no_stdout = 1;
if (opt->err_fd)
strvec_pushl(&cld.args, "upload-pack", "--strict", NULL);
strvec_pushf(&cld.args, "--timeout=%u", timeout);
- strvec_pushv(&cld.env_array, env->v);
+ strvec_pushv(&cld.env, env->v);
return run_service_command(&cld);
}
struct child_process cld = CHILD_PROCESS_INIT;
strvec_push(&cld.args, "upload-archive");
- strvec_pushv(&cld.env_array, env->v);
+ strvec_pushv(&cld.env, env->v);
return run_service_command(&cld);
}
struct child_process cld = CHILD_PROCESS_INIT;
strvec_push(&cld.args, "receive-pack");
- strvec_pushv(&cld.env_array, env->v);
+ strvec_pushv(&cld.env, env->v);
return run_service_command(&cld);
}
char buf[128] = "";
struct sockaddr_in *sin_addr = (void *) addr;
inet_ntop(addr->sa_family, &sin_addr->sin_addr, buf, sizeof(buf));
- strvec_pushf(&cld.env_array, "REMOTE_ADDR=%s", buf);
- strvec_pushf(&cld.env_array, "REMOTE_PORT=%d",
+ strvec_pushf(&cld.env, "REMOTE_ADDR=%s", buf);
+ strvec_pushf(&cld.env, "REMOTE_PORT=%d",
ntohs(sin_addr->sin_port));
#ifndef NO_IPV6
} else if (addr->sa_family == AF_INET6) {
char buf[128] = "";
struct sockaddr_in6 *sin6_addr = (void *) addr;
inet_ntop(AF_INET6, &sin6_addr->sin6_addr, buf, sizeof(buf));
- strvec_pushf(&cld.env_array, "REMOTE_ADDR=[%s]", buf);
- strvec_pushf(&cld.env_array, "REMOTE_PORT=%d",
+ strvec_pushf(&cld.env, "REMOTE_ADDR=[%s]", buf);
+ strvec_pushf(&cld.env, "REMOTE_PORT=%d",
ntohs(sin6_addr->sin6_port));
#endif
}
strvec_pushl(&p.args, editor, realpath.buf, NULL);
if (env)
- strvec_pushv(&p.env_array, (const char **)env);
+ strvec_pushv(&p.env, (const char **)env);
p.use_shell = 1;
p.trace2_child_class = "editor";
if (start_command(&p) < 0) {
return 0;
cp->no_stdin = 1;
- strvec_pushv(&cp->env_array, hook_cb->options->env.v);
+ strvec_pushv(&cp->env, hook_cb->options->env.v);
cp->stdout_to_stderr = 1;
cp->trace2_hook_name = hook_cb->hook_name;
cp->dir = hook_cb->options->dir;
host = "(none)";
if (!getenv("GIT_COMMITTER_NAME"))
- strvec_pushf(&cld.env_array, "GIT_COMMITTER_NAME=%s", user);
+ strvec_pushf(&cld.env, "GIT_COMMITTER_NAME=%s", user);
if (!getenv("GIT_COMMITTER_EMAIL"))
- strvec_pushf(&cld.env_array,
+ strvec_pushf(&cld.env,
"GIT_COMMITTER_EMAIL=%s@http.%s", user, host);
strvec_pushv(&cld.args, argv);
}
}
- strvec_pushv(&cmd->env_array, (const char **)local_repo_env);
+ strvec_pushv(&cmd->env, (const char **)local_repo_env);
cmd->out = -1;
}
{
strvec_push(&pager_process->args, pager);
pager_process->use_shell = 1;
- setup_pager_env(&pager_process->env_array);
+ setup_pager_env(&pager_process->env);
pager_process->trace2_child_class = "pager";
}
/* spawn the pager */
prepare_pager_args(&pager_process, pager);
pager_process.in = -1;
- strvec_push(&pager_process.env_array, "GIT_PAGER_IN_USE");
+ strvec_push(&pager_process.env, "GIT_PAGER_IN_USE");
if (start_command(&pager_process))
return;
child.git_cmd = 1;
child.in = -1;
if (repo != the_repository)
- prepare_other_repo_env(&child.env_array, repo->gitdir);
+ prepare_other_repo_env(&child.env, repo->gitdir);
strvec_pushl(&child.args, "-c", "fetch.negotiationAlgorithm=noop",
"fetch", remote_name, "--no-tags",
"--no-write-fetch-head", "--recurse-submodules=no",
void child_process_clear(struct child_process *child)
{
strvec_clear(&child->args);
- strvec_clear(&child->env_array);
+ strvec_clear(&child->env);
}
struct child_to_clean {
sq_quote_buf_pretty(&buf, cp->dir);
strbuf_addch(&buf, ';');
}
- trace_add_env(&buf, cp->env_array.v);
+ trace_add_env(&buf, cp->env.v);
if (cp->git_cmd)
strbuf_addstr(&buf, " git");
sq_quote_argv_pretty(&buf, cp->args.v);
set_cloexec(null_fd);
}
- childenv = prep_childenv(cmd->env_array.v);
+ childenv = prep_childenv(cmd->env.v);
atfork_prepare(&as);
/*
else if (cmd->use_shell)
cmd->args.v = prepare_shell_cmd(&nargv, sargv);
- cmd->pid = mingw_spawnvpe(cmd->args.v[0], cmd->args.v, (char**) cmd->env_array.v,
- cmd->dir, fhin, fhout, fherr);
+ cmd->pid = mingw_spawnvpe(cmd->args.v[0], cmd->args.v,
+ (char**) cmd->env.v,
+ cmd->dir, fhin, fhout, fherr);
failed_errno = errno;
if (cmd->pid < 0 && (!cmd->silent_exec_failure || errno != ENOENT))
error_errno("cannot spawn %s", cmd->args.v[0]);
cmd.close_object_store = opt & RUN_CLOSE_OBJECT_STORE ? 1 : 0;
cmd.dir = dir;
if (env)
- strvec_pushv(&cmd.env_array, (const char **)env);
+ strvec_pushv(&cmd.env, (const char **)env);
cmd.trace2_child_class = tr2_class;
return run_command(&cmd);
}
* The memory in .env_array will be cleaned up automatically during
* `finish_command` (or during `start_command` when it is unsuccessful).
*/
- struct strvec env_array;
+ struct strvec env;
pid_t pid;
int trace2_child_id;
#define CHILD_PROCESS_INIT { \
.args = STRVEC_INIT, \
- .env_array = STRVEC_INIT, \
+ .env = STRVEC_INIT, \
}
/**
if (is_rebase_i(opts) &&
((opts->committer_date_is_author_date && !opts->ignore_date) ||
!(!defmsg && (flags & AMEND_MSG))) &&
- read_env_script(&cmd.env_array)) {
+ read_env_script(&cmd.env)) {
const char *gpg_opt = gpg_sign_opt_quoted(opts);
return error(_(staged_changes_advice),
}
if (opts->committer_date_is_author_date)
- strvec_pushf(&cmd.env_array, "GIT_COMMITTER_DATE=%s",
+ strvec_pushf(&cmd.env, "GIT_COMMITTER_DATE=%s",
opts->ignore_date ?
"" :
- author_date_from_env_array(&cmd.env_array));
+ author_date_from_env_array(&cmd.env));
if (opts->ignore_date)
- strvec_push(&cmd.env_array, "GIT_AUTHOR_DATE=");
+ strvec_push(&cmd.env, "GIT_AUTHOR_DATE=");
strvec_push(&cmd.args, "commit");
/* Octopus merge */
struct child_process cmd = CHILD_PROCESS_INIT;
- if (read_env_script(&cmd.env_array)) {
+ if (read_env_script(&cmd.env)) {
const char *gpg_opt = gpg_sign_opt_quoted(opts);
ret = error(_(staged_changes_advice), gpg_opt, gpg_opt);
}
if (opts->committer_date_is_author_date)
- strvec_pushf(&cmd.env_array, "GIT_COMMITTER_DATE=%s",
+ strvec_pushf(&cmd.env, "GIT_COMMITTER_DATE=%s",
opts->ignore_date ?
"" :
- author_date_from_env_array(&cmd.env_array));
+ author_date_from_env_array(&cmd.env));
if (opts->ignore_date)
- strvec_push(&cmd.env_array, "GIT_AUTHOR_DATE=");
+ strvec_push(&cmd.env, "GIT_AUTHOR_DATE=");
cmd.git_cmd = 1;
strvec_push(&cmd.args, "merge");
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)) {
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;
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;
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;
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;
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)
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;
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;
"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;
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;
{
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",
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;
}
}
- prepare_submodule_repo_env(&cp.env_array);
+ prepare_submodule_repo_env(&cp.env);
cp.git_cmd = 1;
cp.no_stdin = 1;
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);
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);
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", "--",
while (!strcmp(argv[1], "env")) {
if (!argv[2])
die("env specifier without a value");
- strvec_push(&proc.env_array, argv[2]);
+ strvec_push(&proc.env, argv[2]);
argv += 2;
argc -= 2;
}
strbuf_replace(&cmd, TRAILER_ARG_STRING, arg);
strvec_push(&cp.args, cmd.buf);
}
- strvec_pushv(&cp.env_array, (const char **)local_repo_env);
+ strvec_pushv(&cp.env, (const char **)local_repo_env);
cp.no_stdin = 1;
cp.use_shell = 1;
helper->silent_exec_failure = 1;
if (have_git_dir())
- strvec_pushf(&helper->env_array, "%s=%s",
+ strvec_pushf(&helper->env, "%s=%s",
GIT_DIR_ENVIRONMENT, get_git_dir());
helper->trace2_child_class = helper->args.v[0]; /* "remote-<name>" */
struct strbuf summary = STRBUF_INIT;
char *summary_content;
- strvec_pushf(&sm_summary.env_array, "GIT_INDEX_FILE=%s", s->index_file);
+ strvec_pushf(&sm_summary.env, "GIT_INDEX_FILE=%s", s->index_file);
strvec_push(&sm_summary.args, "submodule");
strvec_push(&sm_summary.args, "summary");