History

try to prevent 'git' reading user and system configuration (#960)

Sebastian Thiel committed 3 years ago

Commit 33be0e01 parent b629f8a1 file · +3 −0Browse files

Unified · Split

tests/tools/src/lib.rs+3−0
@@ -497,6 +497,7 @@ fn configure_command<'a>( · 496 unmodified lines
497 args: &[String],497 args: &[String],
498 script_result_directory: &Path,498 script_result_directory: &Path,
499) -> &'a mut std::process::Command {499) -> &'a mut std::process::Command {
500 let never_path = if cfg!(windows) { "-" } else { ":" };
500 cmd.args(args)501 cmd.args(args)
501 .stdout(std::process::Stdio::piped())502 .stdout(std::process::Stdio::piped())
502 .stderr(std::process::Stdio::piped())503 .stderr(std::process::Stdio::piped())
@@ -504,6 +505,8 @@ fn configure_command<'a>( · 1 unmodified line
504 .env_remove("GIT_DIR")505 .env_remove("GIT_DIR")
505 .env_remove("GIT_ASKPASS")506 .env_remove("GIT_ASKPASS")
506 .env_remove("SSH_ASKPASS")507 .env_remove("SSH_ASKPASS")
508 .env("GIT_CONFIG_SYSTEM", never_path)
509 .env("GIT_CONFIG_GLOBAL", never_path)
507 .env("GIT_TERMINAL_PROMPT", "false")510 .env("GIT_TERMINAL_PROMPT", "false")
508 .env("GIT_AUTHOR_DATE", "2000-01-01 00:00:00 +0000")511 .env("GIT_AUTHOR_DATE", "2000-01-01 00:00:00 +0000")
509 .env("GIT_AUTHOR_EMAIL", "author@example.com")512 .env("GIT_AUTHOR_EMAIL", "author@example.com")