Check if the given path is within a git repository
(repo_path: &Path)
| 3 | |
| 4 | /// Check if the given path is within a git repository |
| 5 | pub async fn is_git_repository(repo_path: &Path) -> Result<bool, String> { |
| 6 | match Repository::open_ext(repo_path, RepositoryOpenFlags::empty(), &[] as &[&Path]) { |
| 7 | Ok(_) => Ok(true), |
| 8 | Err(_) => Ok(false), |
| 9 | } |
| 10 | } |
| 11 | |
| 12 | /// Create a branch from HEAD |
| 13 | /// |
no outgoing calls