Skip to content

Commit daaf5ec

Browse files
committed
Clarify which global program files paths are used and why
1 parent c2c8c2f commit daaf5ec

File tree

2 files changed

+9
-7
lines changed

2 files changed

+9
-7
lines changed

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ where
3939
let varname_current = "ProgramFiles";
4040

4141
// 64-bit relative bin dirs. So far, this is always `mingw64` or `clangarm64`, not `urct64` or
42-
// `clang64`. We check `clangarm64` before `mingw64`, because in the strage case that both are
42+
// `clang64`. We check `clangarm64` before `mingw64`, because in the strange case that both are
4343
// available, we don't want to skip over a native ARM64 executable for an emulated x86_64 one.
4444
let suffixes_64 = [r"Git\clangarm64\bin", r"Git\mingw64\bin"].as_slice();
4545

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

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -181,27 +181,29 @@ mod locations {
181181
Some(folded_text.ends_with(&folded_pattern))
182182
}
183183

184-
/// The common global program files paths on this system, by process and system architecture.
184+
/// The most common global program files paths on this system, by process and system architecture.
185+
///
186+
/// This omits the 32-bit ARM program files directory, as Git for Windows is never installed there.
185187
#[derive(Clone, Debug)]
186188
struct ProgramFilesPaths {
187189
/// The program files directory used for whatever architecture this program was built for.
188190
current: PathBuf,
189191

190-
/// The x86 program files directory regardless of the architecture of the program.
192+
/// The 32-bit x86 program files directory regardless of the architecture of the program.
191193
///
192194
/// If Rust gains Windows targets like ARMv7 where this is unavailable, this could fail.
193195
x86: PathBuf,
194196

195197
/// The 64-bit program files directory if there is one.
196198
///
197-
/// This is present on x64 and also ARM64 systems. On an ARM64 system, ARM64 and AMD64
198-
/// programs use the same program files directory while 32-bit x86 and ARM programs use
199-
/// two others. Only a 32-bit system has no 64-bit program files directory.
199+
/// This is present on x64 (AMD64) and also ARM64 systems. On an ARM64 system, ARM64 and
200+
/// AMD64 programs use the same program files directory while 32-bit x86 and 32-bit ARM
201+
/// programs use two others. Only a 32-bit system has no 64-bit program files directory.
200202
maybe_64bit: Option<PathBuf>,
201203
}
202204

203205
impl ProgramFilesPaths {
204-
/// Get the three common kinds of global program files paths without environment variables.
206+
/// Get the three most common kinds of global program files paths without environment variables.
205207
///
206208
/// The idea here is to obtain this information, which the `alternative_locations()` unit
207209
/// test uses to learn the expected alternative locations, without duplicating *any* of the

0 commit comments

Comments
 (0)