about summary refs log tree commit diff
diff options
context:
space:
mode:
authorChris Denton <chris@chrisdenton.dev>2025-04-28 23:29:18 +0000
committerGitHub <noreply@github.com>2025-04-28 23:29:18 +0000
commitec2dad74a8ddc8117356faa48c4fea12dac1dd5c (patch)
treee1e54b4d163726e97a42ba7dc51d38b3c2ed3f85
parentfd95953d9c561775b2378315561a6adb9dd8a588 (diff)
parent8fa5e3a5718fedfe4faac71179b0c78cce3c9393 (diff)
downloadrust-ec2dad74a8ddc8117356faa48c4fea12dac1dd5c.tar.gz
rust-ec2dad74a8ddc8117356faa48c4fea12dac1dd5c.zip
Rollup merge of #140394 - Kobzol:git-test-self-contained, r=jieyouxu
Make bootstrap git tests more self-contained

Based on https://stackoverflow.com/a/67512433/1107768.

Fixes: https://github.com/rust-lang/rust/issues/140387

r? ```@jieyouxu```
-rw-r--r--src/bootstrap/src/utils/tests/git.rs3
1 files changed, 3 insertions, 0 deletions
diff --git a/src/bootstrap/src/utils/tests/git.rs b/src/bootstrap/src/utils/tests/git.rs
index bd40f398c7b..d9dd9ab9800 100644
--- a/src/bootstrap/src/utils/tests/git.rs
+++ b/src/bootstrap/src/utils/tests/git.rs
@@ -129,6 +129,9 @@ impl GitCtx {
 
     fn git_cmd(&self) -> Command {
         let mut cmd = Command::new("git");
+        cmd.env("GIT_CONFIG_NOSYSTEM", "1");
+        cmd.env("GIT_CONFIG_SYSTEM", "/tmp/nonexistent");
+        cmd.env("GIT_CONFIG_GLOBAL", "/tmp/nonexistent");
         cmd.current_dir(&self.dir);
         cmd
     }