2024-04-16 22:21:55 +01:00
|
|
|
use crate::server::{
|
|
|
|
actors::repo::RepoActor,
|
|
|
|
config::{BranchName, RepoConfig},
|
2024-04-18 19:15:26 +01:00
|
|
|
gitforge,
|
2024-04-16 22:21:55 +01:00
|
|
|
types::GitRef,
|
|
|
|
};
|
|
|
|
|
|
|
|
struct MockForge;
|
|
|
|
#[derive(Clone)]
|
|
|
|
pub struct MockForgeEnv;
|
|
|
|
impl MockForgeEnv {
|
|
|
|
pub(crate) const fn new() -> Self {
|
|
|
|
Self
|
|
|
|
}
|
|
|
|
}
|
|
|
|
#[async_trait::async_trait]
|
|
|
|
impl super::ForgeLike for MockForgeEnv {
|
|
|
|
fn name(&self) -> String {
|
|
|
|
"mock".to_string()
|
|
|
|
}
|
|
|
|
|
2024-04-18 19:15:26 +01:00
|
|
|
async fn branches_get_all(&self) -> Result<Vec<super::Branch>, gitforge::ForgeBranchError> {
|
2024-04-16 22:21:55 +01:00
|
|
|
todo!()
|
|
|
|
}
|
|
|
|
|
|
|
|
async fn file_contents_get(
|
|
|
|
&self,
|
|
|
|
_branch: &BranchName,
|
|
|
|
_file_path: &str,
|
2024-04-18 19:15:26 +01:00
|
|
|
) -> Result<String, gitforge::ForgeFileError> {
|
2024-04-16 22:21:55 +01:00
|
|
|
todo!()
|
|
|
|
}
|
|
|
|
|
|
|
|
async fn branches_validate_positions(
|
|
|
|
&self,
|
|
|
|
_repo_config: RepoConfig,
|
|
|
|
_addr: actix::prelude::Addr<RepoActor>,
|
|
|
|
) {
|
|
|
|
todo!()
|
|
|
|
}
|
|
|
|
|
|
|
|
fn branch_reset(
|
|
|
|
&self,
|
|
|
|
_branch_name: BranchName,
|
|
|
|
_to_commit: GitRef,
|
2024-04-18 19:15:26 +01:00
|
|
|
_force: gitforge::Force,
|
|
|
|
) -> gitforge::BranchResetResult {
|
2024-04-16 22:21:55 +01:00
|
|
|
todo!()
|
|
|
|
}
|
|
|
|
|
2024-04-18 19:15:26 +01:00
|
|
|
async fn commit_status(&self, _commit: &gitforge::Commit) -> gitforge::CommitStatus {
|
2024-04-16 22:21:55 +01:00
|
|
|
todo!()
|
|
|
|
}
|
|
|
|
}
|