1 Subject: [PATCH] run-command.c: unset troublesome PERL env vars
3 Unset troublesome PERL environment variables before exec'ing
4 a sub-process. In particular, PERL5LIB, PERLLIB, PERL5OPT and
5 PERLIO are unset. This avoids, for example, having a PERL5LIB
6 variable set to libraries that would override and be incompatible
7 with the version of Perl the Git perl-based utilities were built
10 But don't do this if we're running the git svn subcommand as it
11 uses the perl found in the current PATH rather than the compile-
14 Signed-off-by: Kyle J. McKay <mackyle@gmail.com>
17 run-command.c | 7 +++++++
18 1 file changed, 7 insertions(+)
20 diff --git a/run-command.c b/run-command.c
21 index aad03ab7..cb99bbfd 100644
24 @@ -416,6 +416,13 @@ fail_pipe:
28 + if (cmd->git_cmd || cmd->use_shell || !cmd->argv ||
29 + !cmd->argv[0] || strcmp(cmd->argv[0], "git-svn")) {
30 + unsetenv("PERL5LIB");
31 + unsetenv("PERLLIB");
32 + unsetenv("PERL5OPT");
36 execv_git_cmd(cmd->argv);
37 else if (cmd->use_shell)