mirror of
https://github.com/git/git.git
synced 2024-10-18 14:38:11 +02:00
Merge branch 'rs/difftool-env-simplify'
Code simplification. * rs/difftool-env-simplify: difftool: add env vars directly in run_file_diff()
This commit is contained in:
commit
df5c2c4962
@ -674,19 +674,15 @@ finish:
|
|||||||
static int run_file_diff(int prompt, const char *prefix,
|
static int run_file_diff(int prompt, const char *prefix,
|
||||||
struct child_process *child)
|
struct child_process *child)
|
||||||
{
|
{
|
||||||
const char *env[] = {
|
strvec_push(&child->env, "GIT_PAGER=");
|
||||||
"GIT_PAGER=", "GIT_EXTERNAL_DIFF=git-difftool--helper", NULL,
|
strvec_push(&child->env, "GIT_EXTERNAL_DIFF=git-difftool--helper");
|
||||||
NULL
|
|
||||||
};
|
|
||||||
|
|
||||||
if (prompt > 0)
|
if (prompt > 0)
|
||||||
env[2] = "GIT_DIFFTOOL_PROMPT=true";
|
strvec_push(&child->env, "GIT_DIFFTOOL_PROMPT=true");
|
||||||
else if (!prompt)
|
else if (!prompt)
|
||||||
env[2] = "GIT_DIFFTOOL_NO_PROMPT=true";
|
strvec_push(&child->env, "GIT_DIFFTOOL_NO_PROMPT=true");
|
||||||
|
|
||||||
child->git_cmd = 1;
|
child->git_cmd = 1;
|
||||||
child->dir = prefix;
|
child->dir = prefix;
|
||||||
strvec_pushv(&child->env, env);
|
|
||||||
|
|
||||||
return run_command(child);
|
return run_command(child);
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user