Skip to content

Commit 948a535

Browse files
ByronEliahKagan
andauthored
Apply suggestions from code review
Co-authored-by: Eliah Kagan <[email protected]>
1 parent 0737c41 commit 948a535

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

gix-path/src/env/mod.rs

+3-3
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ pub fn installation_config_prefix() -> Option<&'static Path> {
3030

3131
/// Return the shell that Git would use, the shell to execute commands from.
3232
///
33-
/// On Windows, this is the full path to `sh.exe` bundled with it, and on
33+
/// On Windows, this is the full path to `sh.exe` bundled with Git, and on
3434
/// Unix it's `/bin/sh` as posix compatible shell.
3535
/// If the bundled shell on Windows cannot be found, `sh` is returned as the name of a shell
3636
/// as it could possibly be found in `PATH`.
@@ -39,7 +39,7 @@ pub fn shell() -> &'static OsStr {
3939
static PATH: Lazy<OsString> = Lazy::new(|| {
4040
if cfg!(windows) {
4141
core_dir()
42-
.and_then(|p| p.ancestors().nth(3) /* skip mingw64/libexec/git-core */)
42+
.and_then(|p| p.ancestors().nth(3)) // Skip something like mingw64/libexec/git-core.
4343
.map(|p| p.join("usr").join("bin").join("sh.exe"))
4444
.map_or_else(|| OsString::from("sh"), Into::into)
4545
} else {
@@ -122,7 +122,7 @@ static GIT_CORE_DIR: Lazy<Option<PathBuf>> = Lazy::new(|| {
122122
}
123123

124124
BString::new(output.stdout)
125-
.trim_with(|b| b.is_ascii_whitespace())
125+
.strip_suffix(b"\n")?
126126
.to_path()
127127
.ok()?
128128
.to_owned()

gix-path/tests/path/env.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ fn installation_config() {
2727
#[test]
2828
fn core_dir() {
2929
assert!(
30-
gix_path::env::core_dir().expect("Git is always in PATH").is_dir(),
30+
gix_path::env::core_dir().expect("Git is always in PATH when we run tests").is_dir(),
3131
"The core directory is a valid directory"
3232
);
3333
}

0 commit comments

Comments
 (0)