Skip to content

Commit 29c6cca

Browse files
committed
Explain why we don't just use --system
1 parent f35e44c commit 29c6cca

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

gix-path/src/env/git/mod.rs

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -120,6 +120,11 @@ fn git_cmd(executable: PathBuf) -> Command {
120120
// Low versions of git are still sometimes used, and this is sometimes reasonable because
121121
// downstream distributions often backport security patches without adding most new features.
122122
// So for now, we forgo the convenience of --show-scope for greater backward compatibility.
123+
//
124+
// Separately from that, we can't use --system here, because scopes treated higher than the
125+
// system scope are possible. This commonly happens on macOS with Apple Git, where the config
126+
// file under /Library is shown as an "unknown" scope but takes precedence over the system
127+
// scope. Although GIT_CONFIG_NOSYSTEM will suppress this as well, passing --system omits it.
123128
cmd.args(["config", "-lz", "--show-origin", "--name-only"])
124129
.current_dir(env::temp_dir())
125130
.env("GIT_DIR", NULL_DEVICE) // Avoid getting local-scope config.

0 commit comments

Comments
 (0)