ShellCommand: De-virtualize environment()

Provide instead a protected setter, used in VcsCommand c'tor.

Remove a forceCLocale arg from setProcessEnvironment() method,
as it is used only in VcsCommand context when
ShellCommand::ForceCLocale flag was set. Move setting
C locale env directly to the shell command, just before
the command is executed, so that we are sure the flag
was already set.

Modify env directly in VcsCommand c'tor with regards to
SSH_ASKPASS variable.

Change-Id: Icff555ade4984368f7ce79f762d1bb5d3614076a
Reviewed-by: Orgad Shaneh <orgads@gmail.com>
This commit is contained in:
Jarek Kobus
2022-07-13 17:54:59 +02:00
parent 68bb3b99a9
commit 85071d8e8d
7 changed files with 22 additions and 23 deletions

View File

@@ -734,12 +734,8 @@ QString source(IDocument *document)
return document->property(SOURCE_PROPERTY).toString();
}
void setProcessEnvironment(Environment *e, bool forceCLocale)
void setProcessEnvironment(Environment *e)
{
if (forceCLocale) {
e->set("LANG", "C");
e->set("LANGUAGE", "C");
}
const QString prompt = Internal::VcsPlugin::instance()->settings().sshPasswordPrompt.value();
if (!prompt.isEmpty())
e->set("SSH_ASKPASS", prompt);