git-next/crates/gitforge/src/mock_forge.rs

59 lines
1.3 KiB
Rust
Raw Normal View History

use git::OpenRepository;
use git_next_config::{BranchName, GitDir, RepoConfig};
use git_next_git::{self as git, GitRef};
use crate::{branch, file, validation, CommitStatus};
struct MockForge;
#[derive(Clone, Debug)]
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()
}
async fn branches_get_all(&self) -> Result<Vec<BranchName>, branch::Error> {
todo!()
}
async fn file_contents_get(
&self,
_branch: &BranchName,
_file_path: &str,
) -> Result<String, file::Error> {
todo!()
}
async fn branches_validate_positions(
&self,
_repository: OpenRepository,
_repo_config: RepoConfig,
) -> validation::Result {
todo!()
}
fn branch_reset(
&self,
_repository: &OpenRepository,
_branch_name: BranchName,
_to_commit: GitRef,
2024-05-16 14:45:25 +01:00
_force: git::push::Force,
) -> git::push::Result {
todo!()
}
async fn commit_status(&self, _commit: &git::Commit) -> CommitStatus {
todo!()
}
fn repo_clone(&self, _gitdir: GitDir) -> Result<OpenRepository, git::repository::Error> {
todo!()
}
}