Get diff output.
(repo_path: &Path, target: Option<&str>)
| 617 | |
| 618 | /// Get diff output. |
| 619 | pub fn get_diff(repo_path: &Path, target: Option<&str>) -> Result<String> { |
| 620 | let args: Vec<&str> = if let Some(t) = target { |
| 621 | vec!["diff", t] |
| 622 | } else { |
| 623 | vec!["diff", "--stat"] |
| 624 | }; |
| 625 | |
| 626 | let (_, stdout, _) = run_git(repo_path, &args)?; |
| 627 | Ok(stdout) |
| 628 | } |
| 629 | |
| 630 | /// Stash information. |
| 631 | #[derive(Debug, Clone)] |