2024-04-16 22:21:55 +01:00
|
|
|
use crate::server::{
|
|
|
|
actors::repo::RepoActor,
|
2024-04-21 18:47:07 +01:00
|
|
|
config::{BranchName, GitDir, RepoConfig},
|
2024-05-09 21:18:40 +01:00
|
|
|
gitforge::{self, RepoCloneError, Repository},
|
2024-05-05 08:17:32 +01:00
|
|
|
types::{GitRef, MessageToken},
|
2024-04-16 22:21:55 +01:00
|
|
|
};
|
|
|
|
|
|
|
|
struct MockForge;
|
2024-05-04 12:37:35 +01:00
|
|
|
#[derive(Clone, Debug)]
|
2024-04-16 22:21:55 +01:00
|
|
|
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>,
|
2024-05-05 08:17:32 +01:00
|
|
|
_message_token: MessageToken,
|
2024-04-16 22:21:55 +01:00
|
|
|
) {
|
|
|
|
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!()
|
|
|
|
}
|
2024-04-19 18:56:42 +01:00
|
|
|
|
2024-05-09 21:18:40 +01:00
|
|
|
fn repo_clone(&self, _gitdir: GitDir) -> Result<Repository, RepoCloneError> {
|
2024-04-19 18:56:42 +01:00
|
|
|
todo!()
|
|
|
|
}
|
2024-04-16 22:21:55 +01:00
|
|
|
}
|