MCPcopy Create free account
hub / github.com/dtormoen/tsk-tsk / is_git_repository

Function is_git_repository

src/git_operations.rs:5–10  ·  view source on GitHub ↗

Check if the given path is within a git repository

(repo_path: &Path)

Source from the content-addressed store, hash-verified

3
4/// Check if the given path is within a git repository
5pub 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///

Calls

no outgoing calls