History

Set GIT_WORK_TREE along with GIT_DIR, to avoid confusion

This is really just to make things less surprising when debugging. This also adds a comment to explain why `GIT_DIR` is being set.

Eliah Kagan committed 2 years ago

Commit 57230771 parent 7280a2d1 file · +2 −1Browse files

Unified · Split

gix-path/src/env/git/mod.rs+2−1
@@ -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 cmd125 cmd

Keyboard shortcuts

General

Show keyboard shortcuts
?
Focus the current search
/

Issues and pull requests

Open filters
f

Issues, pull requests and Inbox

Select next item
j↓
Select previous item
k↑
Open selected item
Enter
Dismiss filters or clear selection
Esc

Repository code

Go to file
t