Skip to content
Clone
a06673b
109 lines 2.7 KB Rust
use crate::error::{RepoError, RepoResult};
use crate::features::RepoService;
use super::types::{BlobView, CommitDiffPayload, CommitView, GitRef, NoteView, TreeView};
pub async fn list_git_refs(
_svc: &RepoService,
actor: uuid::Uuid,
_repo_id: uuid::Uuid,
) -> RepoResult<Vec<GitRef>> {
let _ = actor;
Err(RepoError::Internal(
"list refs requires lib/git rewire (in progress)".into(),
))
}
pub async fn filter_git_refs(
_svc: &RepoService,
actor: uuid::Uuid,
_repo_id: uuid::Uuid,
_filter: &str,
) -> RepoResult<Vec<GitRef>> {
let _ = actor;
Err(RepoError::Internal(
"filter refs requires lib/git rewire (in progress)".into(),
))
}
pub async fn get_commit(
_svc: &RepoService,
actor: uuid::Uuid,
_repo_id: uuid::Uuid,
sha: &str,
) -> RepoResult<CommitView> {
let _ = actor;
if sha.is_empty() {
return Err(RepoError::BadRequest("sha is required".into()));
}
Err(RepoError::Internal(
"get_commit requires lib/git rewire (in progress)".into(),
))
}
pub async fn get_commit_diff_or_patch(
_svc: &RepoService,
actor: uuid::Uuid,
_repo_id: uuid::Uuid,
sha: &str,
diff_type: &str,
) -> RepoResult<CommitDiffPayload> {
let _ = actor;
if diff_type != "diff" && diff_type != "patch" {
return Err(RepoError::BadRequest(format!(
"unsupported diff format: {diff_type}"
)));
}
if sha.is_empty() {
return Err(RepoError::BadRequest("sha is required".into()));
}
Err(RepoError::Internal(
"get_commit_diff_or_patch requires lib/git rewire (in progress)".into(),
))
}
pub async fn get_tree(
_svc: &RepoService,
actor: uuid::Uuid,
_repo_id: uuid::Uuid,
sha: &str,
_recursive: bool,
) -> RepoResult<TreeView> {
let _ = actor;
if sha.is_empty() {
return Err(RepoError::BadRequest("sha is required".into()));
}
Err(RepoError::Internal(
"get_tree requires lib/git rewire (in progress)".into(),
))
}
pub async fn get_blob(
_svc: &RepoService,
actor: uuid::Uuid,
_repo_id: uuid::Uuid,
sha: &str,
) -> RepoResult<BlobView> {
let _ = actor;
if sha.is_empty() {
return Err(RepoError::BadRequest("sha is required".into()));
}
Err(RepoError::Internal(
"get_blob requires lib/git rewire (in progress)".into(),
))
}
pub async fn get_note(
_svc: &RepoService,
actor: uuid::Uuid,
_repo_id: uuid::Uuid,
sha: &str,
) -> RepoResult<NoteView> {
let _ = actor;
if sha.is_empty() {
return Err(RepoError::BadRequest("sha is required".into()));
}
Err(RepoError::Internal(
"get_note requires lib/git rewire (in progress)".into(),
))
}