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
497497 args: &[String],
498498 script_result_directory: &Path,
499499 ) -> &'a mut std::process::Command {
500+ let never_path = if cfg!(windows) { "-" } else { ":" };
500501 cmd.args(args)
501502 .stdout(std::process::Stdio::piped())
502503 .stderr(std::process::Stdio::piped())
@@ -504,6 +505,8 @@ fn configure_command<'a>( · 1 unmodified line
504505 .env_remove("GIT_DIR")
505506 .env_remove("GIT_ASKPASS")
506507 .env_remove("SSH_ASKPASS")
508+ .env("GIT_CONFIG_SYSTEM", never_path)
509+ .env("GIT_CONFIG_GLOBAL", never_path)
507510 .env("GIT_TERMINAL_PROMPT", "false")
508511 .env("GIT_AUTHOR_DATE", "2000-01-01 00:00:00 +0000")
509512 .env("GIT_AUTHOR_EMAIL", "author@example.com")