mirror of
https://github.com/git/git.git
synced 2025-12-12 20:36:24 +01:00
run-command API: rename "env_array" to "env"
Start following-up on the rename mentioned inc7c4bdeccf(run-command API: remove "env" member, always use "env_array", 2021-11-25) of "env_array" to "env". The "env_array" name was picked in19a583dc39(run-command: add env_array, an optional argv_array for env, 2014-10-19) because "env" was taken. Let's not forever keep the oddity of "*_array" for this "struct strvec", but not for its "args" sibling. This commit is almost entirely made with a coccinelle rule[1]. The only manual change here is in run-command.h to rename the struct member itself and to change "env_array" to "env" in the CHILD_PROCESS_INIT initializer. The rest of this is all a result of applying [1]: * make contrib/coccinelle/run_command.cocci.patch * patch -p1 <contrib/coccinelle/run_command.cocci.patch * git add -u 1. cat contrib/coccinelle/run_command.pending.cocci @@ struct child_process E; @@ - E.env_array + E.env @@ struct child_process *E; @@ - E->env_array + E->env I've avoided changing any comments and derived variable names here, that will all be done in the next commit. Signed-off-by: Ævar Arnfjörð Bjarmason <avarab@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
This commit is contained in:
committed by
Junio C Hamano
parent
07330a41d6
commit
29fda24dd1
4
pager.c
4
pager.c
@@ -99,7 +99,7 @@ void prepare_pager_args(struct child_process *pager_process, const char *pager)
|
||||
{
|
||||
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";
|
||||
}
|
||||
|
||||
@@ -129,7 +129,7 @@ void setup_pager(void)
|
||||
/* 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;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user