(path: &Path)
| 206 | } |
| 207 | |
| 208 | pub fn get_root(path: &Path) -> Option<std::path::PathBuf> { |
| 209 | let result = run(&["rev-parse", "--show-toplevel"], path); |
| 210 | if result.success() { |
| 211 | Some(std::path::PathBuf::from(result.stdout.trim())) |
| 212 | } else { |
| 213 | None |
| 214 | } |
| 215 | } |
| 216 | |
| 217 | pub fn get_current_branch(path: &Path) -> Option<String> { |
| 218 | let result = run(&["branch", "--show-current"], path); |