Skip to content

Commit 3faa074

Browse files
c00tarxanas
authored andcommitted
fix(hooks): different PATH's name on windows and linux
1 parent e7c3653 commit 3faa074

File tree

1 file changed

+5
-0
lines changed
  • git-branchless-lib/src/git

1 file changed

+5
-0
lines changed

git-branchless-lib/src/git/run.rs

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -418,6 +418,11 @@ impl GitRunInfo {
418418
if let Some(path) = env.get(OsStr::new("PATH")) {
419419
path_components.extend(std::env::split_paths(path));
420420
}
421+
// On windows, PATH's name defaults to "Path".
422+
#[cfg(target_os = "windows")]
423+
if let Some(path) = env.get(OsStr::new("Path")) {
424+
path_components.extend(std::env::split_paths(path));
425+
}
421426
std::env::join_paths(path_components).wrap_err("Joining path components")?
422427
};
423428

0 commit comments

Comments
 (0)