MCPcopy Create free account
hub / github.com/ChrisFeldmeier/OpenCodeRust / is_git_repository

Function is_git_repository

crates/opencode-server/src/routes.rs:3279–3290  ·  view source on GitHub ↗
(path: &FsPath)

Source from the content-addressed store, hash-verified

3277 Lazy::new(|| RwLock::new(HashMap::new()));
3278
3279fn is_git_repository(path: &FsPath) -> bool {
3280 let output = std::process::Command::new("git")
3281 .arg("-C")
3282 .arg(path)
3283 .arg("rev-parse")
3284 .arg("--is-inside-work-tree")
3285 .output();
3286 match output {
3287 Ok(out) if out.status.success() => String::from_utf8_lossy(&out.stdout).trim() == "true",
3288 _ => false,
3289 }
3290}
3291
3292async fn current_project_info() -> Result<ProjectInfo> {
3293 let cwd = std::env::current_dir()

Callers 1

current_project_infoFunction · 0.85

Calls 3

newFunction · 0.85
outputMethod · 0.80
successMethod · 0.45

Tested by

no test coverage detected