2024-05-23 08:53:16 +01:00
|
|
|
//
|
|
|
|
#![cfg(not(tarpaulin_include))]
|
|
|
|
|
2024-05-18 11:41:18 +01:00
|
|
|
use git::OpenRepository;
|
2024-05-11 19:46:20 +01:00
|
|
|
use git_next_config::{BranchName, GitDir, RepoConfig};
|
2024-05-18 11:41:18 +01:00
|
|
|
use git_next_git::{self as git, GitRef};
|
2024-05-11 19:46:20 +01:00
|
|
|
|
2024-05-23 08:30:58 +01:00
|
|
|
use crate::{branch, file, validation};
|
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-05-23 08:01:16 +01:00
|
|
|
async fn branches_get_all(&self) -> Result<Vec<BranchName>, branch::Error> {
|
2024-04-16 22:21:55 +01:00
|
|
|
todo!()
|
|
|
|
}
|
|
|
|
|
|
|
|
async fn file_contents_get(
|
|
|
|
&self,
|
|
|
|
_branch: &BranchName,
|
|
|
|
_file_path: &str,
|
2024-05-23 08:01:16 +01:00
|
|
|
) -> Result<String, file::Error> {
|
2024-04-16 22:21:55 +01:00
|
|
|
todo!()
|
|
|
|
}
|
|
|
|
|
|
|
|
async fn branches_validate_positions(
|
|
|
|
&self,
|
2024-05-18 11:41:18 +01:00
|
|
|
_repository: OpenRepository,
|
2024-04-16 22:21:55 +01:00
|
|
|
_repo_config: RepoConfig,
|
2024-05-22 08:41:30 +01:00
|
|
|
) -> validation::Result {
|
2024-04-16 22:21:55 +01:00
|
|
|
todo!()
|
|
|
|
}
|
|
|
|
|
|
|
|
fn branch_reset(
|
|
|
|
&self,
|
2024-05-18 11:41:18 +01:00
|
|
|
_repository: &OpenRepository,
|
2024-04-16 22:21:55 +01:00
|
|
|
_branch_name: BranchName,
|
|
|
|
_to_commit: GitRef,
|
2024-05-16 14:45:25 +01:00
|
|
|
_force: git::push::Force,
|
|
|
|
) -> git::push::Result {
|
2024-04-16 22:21:55 +01:00
|
|
|
todo!()
|
|
|
|
}
|
|
|
|
|
2024-05-23 08:30:58 +01:00
|
|
|
async fn commit_status(&self, _commit: &git::Commit) -> git::commit::Status {
|
2024-04-16 22:21:55 +01:00
|
|
|
todo!()
|
|
|
|
}
|
2024-04-19 18:56:42 +01:00
|
|
|
|
2024-05-18 11:41:18 +01:00
|
|
|
fn repo_clone(&self, _gitdir: GitDir) -> Result<OpenRepository, git::repository::Error> {
|
2024-04-19 18:56:42 +01:00
|
|
|
todo!()
|
|
|
|
}
|
2024-04-16 22:21:55 +01:00
|
|
|
}
|