You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Extract system_prefix() Windows strategies to helpers
This refactors `gix_path::env::system_prefix()` by extracting the
two strategies used to obtain it on Windows to newly created helper
functions: `system_prefix_from_exepath_var()` for the `EXEPATH`
optimization, and `system_prefix_from_core_dir()` for the fallback.
This is to facilitate testing. The new helpers take the functions
they call to obtain systemwide information (`EXEPATH` from the
environment, or the once-computed `GIT_CORE_DIR`) by dependency
injection, so tests can be added that cover the important cases.
This is similar to the approach for `ALTERNATIVE_LOCATIONS` of
using a `locations_under_program_files()` helper (since GitoxideLabs#1456). The
`system_prefix_from_exepath_var()` helper treats its `var_os_func`
parameter analogously to how `locations_under_program_files()`
treats its `var_os_func` parameter.
0 commit comments