diff --git a/libs/git/hook/pool/mod.rs b/libs/git/hook/pool/mod.rs index cd4af93..cb520fa 100644 --- a/libs/git/hook/pool/mod.rs +++ b/libs/git/hook/pool/mod.rs @@ -259,6 +259,13 @@ impl GitHookPool { .map_err(crate::GitError::from)? .ok_or_else(|| crate::GitError::NotFound(format!("repo {} not found", repo_id)))?; + // Fail fast if storage path doesn't exist — avoid blocking spawn_blocking thread pool. + if !std::path::Path::new(&repo.storage_path).exists() { + return Err(crate::GitError::NotFound(format!( + "storage path does not exist: {}", repo.storage_path + ))); + } + let db_clone = self.db.clone(); let cache_clone = self.cache.clone(); let repo_clone = repo.clone();