@@ -27,19 +27,21 @@ where
2727 let varname_x86 = "ProgramFiles(x86)" ;
2828
2929 // Should give a 32-bit program files path on a 32-bit system. We also check this on a 64-bit
30- // system, even though it *should* equal the process's architecture specific variable, so that
30+ // system, even though it *should* equal the process's architecture- specific variable, so that
3131 // we cover the case of a parent process that passes down an overly sanitized environment that
3232 // lacks the architecture-specific variable. On a 64-bit system, because parent and child
33- // processes' architectures can be different, Windows sets the child's ProgramFiles variable
34- // from the ProgramW6432 or ProgramFiles(x86) variable applicable to the child's architecture.
35- // Only if the parent does not pass that down is the passed-down ProgramFiles variable even
36- // used. But this behavior is not well known, so that situation does sometimes happen.
33+ // processes' architectures can be different, Windows sets the child's `ProgramFiles` variable
34+ // from whichever of the `ProgramW6432` or `ProgramFiles(x86)` variable corresponds to the
35+ // child's architecture. Only if the parent does not pass down the architecture-specific
36+ // variable corresponding to the child's architecture does the child receive its `ProgramFiles`
37+ // variable from `ProgramFiles` as passed down by the parent. But this behavior is not well
38+ // known. So the situation where a process only passes down `ProgramFiles` sometimes happens.
3739 let varname_current = "ProgramFiles" ;
3840
39- // 64-bit relative bin dir. So far, this is always mingw64, not ucrt64, clang64, or clangarm64.
41+ // 64-bit relative bin dir. So far, this is always ` mingw64` , not ` ucrt64`, ` clang64` , or ` clangarm64` .
4042 let suffix_64 = Path :: new ( r"Git\mingw64\bin" ) ;
4143
42- // 32-bit relative bin dir. So far, this is always mingw32, not clang32.
44+ // 32-bit relative bin dir. So far, this is always ` mingw32` , not ` clang32` .
4345 let suffix_32 = Path :: new ( r"Git\mingw32\bin" ) ;
4446
4547 // Whichever of the 64-bit or 32-bit relative bin better matches this process's architecture.
@@ -81,7 +83,7 @@ pub(super) const EXE_NAME: &str = "git";
8183
8284/// Invoke the git executable to obtain the origin configuration, which is cached and returned.
8385///
84- /// The git executable is the one found in PATH or an alternative location.
86+ /// The git executable is the one found in ` PATH` or an alternative location.
8587pub ( super ) static GIT_HIGHEST_SCOPE_CONFIG_PATH : Lazy < Option < BString > > = Lazy :: new ( exe_info) ;
8688
8789// There are a number of ways to refer to the null device on Windows, but they are not all equally
@@ -134,17 +136,17 @@ fn git_cmd(executable: PathBuf) -> Command {
134136 } else {
135137 "/" . into ( )
136138 } ;
137- // Git 2.8.0 and higher support --show-origin. The -l, -z , and --name-only options were
138- // supported even before that. In contrast, --show-scope was introduced later, in Git 2.26.0.
139+ // Git 2.8.0 and higher support ` --show-origin` . The `-l`, `-z` , and ` --name-only` options were
140+ // supported even before that. In contrast, ` --show-scope` was introduced later, in Git 2.26.0.
139141 // Low versions of Git are still sometimes used, and this is sometimes reasonable because
140142 // downstream distributions often backport security patches without adding most new features.
141- // So for now, we forgo the convenience of --show-scope for greater backward compatibility.
143+ // So for now, we forgo the convenience of ` --show-scope` for greater backward compatibility.
142144 //
143- // Separately from that, we can't use --system here, because scopes treated higher than the
145+ // Separately from that, we can't use ` --system` here, because scopes treated higher than the
144146 // system scope are possible. This commonly happens on macOS with Apple Git, where the config
145147 // file under `/Library` or `/Applications` is shown as an "unknown" scope but takes precedence
146148 // over the system scope. Although `GIT_CONFIG_NOSYSTEM` suppresses this scope along with the
147- // system scope, passing --system selects only the system scope and omit this "unknown" scope.
149+ // system scope, passing ` --system` selects only the system scope and not this "unknown" scope.
148150 cmd. args ( [ "config" , "-lz" , "--show-origin" , "--name-only" ] )
149151 . current_dir ( cwd)
150152 . env_remove ( "GIT_CONFIG" )
@@ -165,7 +167,7 @@ fn first_file_from_config_with_origin(source: &BStr) -> Option<&BStr> {
165167 file[ ..end_pos] . as_bstr ( ) . into ( )
166168}
167169
168- /// Try to find the file that contains git configuration coming with the git installation.
170+ /// Try to find the file that contains Git configuration coming with the Git installation.
169171///
170172/// This returns the configuration associated with the `git` executable found in the current `PATH`
171173/// or an alternative location, or `None` if no `git` executable was found or there were other
0 commit comments