This is really just to make things less surprising when debugging. This also adds a comment to explain why `GIT_DIR` is being set.
Unified · Split
| @@ -118,7 +118,8 @@ fn git_cmd(executable: PathBuf) -> Command { · 117 unmodified lines | |||
| 118 | // git 2.8.0 and higher support --show-origin. | 118 | // git 2.8.0 and higher support --show-origin. |
| 119 | cmd.args(["config", "-lz", "--show-origin", "--name-only"]) | 119 | cmd.args(["config", "-lz", "--show-origin", "--name-only"]) |
| 120 | .current_dir(env::temp_dir()) | 120 | .current_dir(env::temp_dir()) |
| 121 | .env("GIT_DIR", NULL_DEVICE) | 121 | .env("GIT_DIR", NULL_DEVICE) // Avoid getting local-scope config. |
| 122 | .env("GIT_WORK_TREE", NULL_DEVICE) // Not needed, but clarifies intent. | ||
| 122 | .stdin(Stdio::null()) | 123 | .stdin(Stdio::null()) |
| 123 | .stderr(Stdio::null()); | 124 | .stderr(Stdio::null()); |
| 124 | cmd | 125 | cmd |