()
| 161 | |
| 162 | #[cfg(test)] |
| 163 | fn git_command() -> Command { |
| 164 | let mut command = Command::new("git"); |
| 165 | let mut paths: Vec<PathBuf> = std::env::var_os("PATH") |
| 166 | .map(|path| std::env::split_paths(&path).collect()) |
| 167 | .unwrap_or_default(); |
| 168 | #[cfg(not(windows))] |
| 169 | { |
| 170 | paths.push(PathBuf::from("/usr/bin")); |
| 171 | paths.push(PathBuf::from("/bin")); |
| 172 | } |
| 173 | if let Ok(path) = std::env::join_paths(paths) { |
| 174 | command.env("PATH", path); |
| 175 | } |
| 176 | command |
| 177 | } |
| 178 | |
| 179 | #[cfg(not(test))] |
| 180 | fn git_command() -> Command { |
no test coverage detected