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 | 118 | // git 2.8.0 and higher support --show-origin. |
| 119 | 119 | cmd.args(["config", "-lz", "--show-origin", "--name-only"]) |
| 120 | 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 | 123 | .stdin(Stdio::null()) |
| 123 | 124 | .stderr(Stdio::null()); |
| 124 | 125 | cmd |