diff --git a/src/database/connection.rs b/src/database/connection.rs index ee7da02..98c8635 100644 --- a/src/database/connection.rs +++ b/src/database/connection.rs @@ -7854,6 +7854,9 @@ mod tests { let status = std::process::Command::new("git") .args(args) .current_dir(repo) + // Do not inherit developer's git configuration. + .env("GIT_CONFIG_GLOBAL", "/dev/null") + .env("GIT_CONFIG_SYSTEM", "/dev/null") .env("GIT_AUTHOR_NAME", "Semcode Test") .env("GIT_AUTHOR_EMAIL", "semcode@example.com") .env("GIT_COMMITTER_NAME", "Semcode Test") diff --git a/src/git.rs b/src/git.rs index 0704d0c..97e69db 100644 --- a/src/git.rs +++ b/src/git.rs @@ -235,6 +235,9 @@ mod tests { let status = std::process::Command::new("git") .args(args) .current_dir(dir.path()) + // Do not inherit developer's git configuration. + .env("GIT_CONFIG_GLOBAL", "/dev/null") + .env("GIT_CONFIG_SYSTEM", "/dev/null") .env("GIT_AUTHOR_NAME", "Semcode Test") .env("GIT_AUTHOR_EMAIL", "semcode@example.com") .env("GIT_COMMITTER_NAME", "Semcode Test") diff --git a/src/indexer.rs b/src/indexer.rs index a7a9f48..2752ea1 100644 --- a/src/indexer.rs +++ b/src/indexer.rs @@ -1146,6 +1146,9 @@ mod tests { let out = std::process::Command::new("git") .args(args) .current_dir(repo) + // Do not inherit developer's git configuration. + .env("GIT_CONFIG_GLOBAL", "/dev/null") + .env("GIT_CONFIG_SYSTEM", "/dev/null") .env("GIT_AUTHOR_NAME", "test") .env("GIT_AUTHOR_EMAIL", "test@test.com") .env("GIT_COMMITTER_NAME", "test") diff --git a/src/workdir.rs b/src/workdir.rs index d2128eb..733e1c8 100644 --- a/src/workdir.rs +++ b/src/workdir.rs @@ -713,11 +713,17 @@ void hello(void); std::process::Command::new("git") .args(["add", "."]) .current_dir(&repo_path) + // Do not inherit developer's git configuration. + .env("GIT_CONFIG_GLOBAL", "/dev/null") + .env("GIT_CONFIG_SYSTEM", "/dev/null") .output() .unwrap(); std::process::Command::new("git") .args(["commit", "-m", "initial"]) .current_dir(&repo_path) + // Do not inherit developer's git configuration. + .env("GIT_CONFIG_GLOBAL", "/dev/null") + .env("GIT_CONFIG_SYSTEM", "/dev/null") .env("GIT_AUTHOR_NAME", "test") .env("GIT_AUTHOR_EMAIL", "test@test.com") .env("GIT_COMMITTER_NAME", "test") @@ -791,6 +797,9 @@ int multiply(int a, int b) { std::process::Command::new("git") .args(["add", "new.c"]) .current_dir(&repo_path) + // Do not inherit developer's git configuration. + .env("GIT_CONFIG_GLOBAL", "/dev/null") + .env("GIT_CONFIG_SYSTEM", "/dev/null") .output() .unwrap(); @@ -831,6 +840,9 @@ int multiply(int a, int b) { std::process::Command::new("git") .args(["add", "new.c"]) .current_dir(&repo_path) + // Do not inherit developer's git configuration. + .env("GIT_CONFIG_GLOBAL", "/dev/null") + .env("GIT_CONFIG_SYSTEM", "/dev/null") .output() .unwrap(); diff --git a/tests/ambiguous_callees.rs b/tests/ambiguous_callees.rs index 025b1a4..55e6cfd 100644 --- a/tests/ambiguous_callees.rs +++ b/tests/ambiguous_callees.rs @@ -10,6 +10,9 @@ fn git_run(repo: &Path, args: &[&str]) { let status = Command::new("git") .args(args) .current_dir(repo) + // Do not inherit developer's git configuration. + .env("GIT_CONFIG_GLOBAL", "/dev/null") + .env("GIT_CONFIG_SYSTEM", "/dev/null") .env("GIT_AUTHOR_NAME", "Semcode Test") .env("GIT_AUTHOR_EMAIL", "semcode@example.com") .env("GIT_COMMITTER_NAME", "Semcode Test") diff --git a/tests/indirect_calls.rs b/tests/indirect_calls.rs index 17ea0b9..8c57612 100644 --- a/tests/indirect_calls.rs +++ b/tests/indirect_calls.rs @@ -34,6 +34,9 @@ fn git_run(repo: &Path, args: &[&str]) { let status = Command::new("git") .args(args) .current_dir(repo) + // Do not inherit developer's git configuration. + .env("GIT_CONFIG_GLOBAL", "/dev/null") + .env("GIT_CONFIG_SYSTEM", "/dev/null") .env("GIT_AUTHOR_NAME", "Semcode Test") .env("GIT_AUTHOR_EMAIL", "semcode@example.com") .env("GIT_COMMITTER_NAME", "Semcode Test") diff --git a/tests/revision_scoping.rs b/tests/revision_scoping.rs index af4678b..c676004 100644 --- a/tests/revision_scoping.rs +++ b/tests/revision_scoping.rs @@ -11,6 +11,9 @@ fn git_run(repo: &Path, args: &[&str]) { let status = Command::new("git") .args(args) .current_dir(repo) + // Do not inherit developer's git configuration. + .env("GIT_CONFIG_GLOBAL", "/dev/null") + .env("GIT_CONFIG_SYSTEM", "/dev/null") .env("GIT_AUTHOR_NAME", "Semcode Test") .env("GIT_AUTHOR_EMAIL", "semcode@example.com") .env("GIT_COMMITTER_NAME", "Semcode Test")