diff --git a/libs/git/hook/pool/mod.rs b/libs/git/hook/pool/mod.rs index cb520fa..c7e513f 100644 --- a/libs/git/hook/pool/mod.rs +++ b/libs/git/hook/pool/mod.rs @@ -439,6 +439,12 @@ impl GitHookPool { .map_err(crate::GitError::from)? .ok_or_else(|| crate::GitError::NotFound(format!("repo {} not found", repo_id)))?; + if !std::path::Path::new(&repo.storage_path).exists() { + return Err(crate::GitError::NotFound(format!( + "storage path does not exist: {}", repo.storage_path + ))); + } + self.log_stream .info(&task.id, &task.repo_id, "running fsck") .await; @@ -471,6 +477,12 @@ impl GitHookPool { .map_err(crate::GitError::from)? .ok_or_else(|| crate::GitError::NotFound(format!("repo {} not found", repo_id)))?; + if !std::path::Path::new(&repo.storage_path).exists() { + return Err(crate::GitError::NotFound(format!( + "storage path does not exist: {}", repo.storage_path + ))); + } + self.log_stream .info(&task.id, &task.repo_id, "running gc") .await;