(current_dir: P, arguments: I)
| 302 | |
| 303 | #[allow(dead_code)] |
| 304 | pub fn run_git_command<I, T, P: AsRef<Path>>(current_dir: P, arguments: I) -> Output |
| 305 | where |
| 306 | I: IntoIterator<Item = T>, |
| 307 | T: AsRef<OsStr>, |
| 308 | { |
| 309 | let mut current_dir_buf: PathBuf = current_dir.as_ref().into(); |
| 310 | if current_dir_buf.is_relative() { |
| 311 | current_dir_buf = current_dir_buf.canonicalize().unwrap(); |
| 312 | } |
| 313 | |
| 314 | let output = assert_cmd::Command::from_std(Command::new("git")) |
| 315 | .current_dir(current_dir_buf) |
| 316 | .args(arguments) |
| 317 | .output() |
| 318 | .expect("Failed to run git"); |
| 319 | |
| 320 | output |
| 321 | } |
| 322 | |
| 323 | #[allow(dead_code)] |
| 324 | pub fn run_test_bin_for_rebase<I, T, P: AsRef<Path>>(current_dir: P, arguments: I) -> Output |
no outgoing calls