420dedbc1e
- Add IM service modules: audit, channel roles, custom emojis, forum tags, integrations, invitations, repo links, slash commands, stages, voice, webhooks - Add PR service modules: review requests, templates - Add repo service modules: contributors, release assets, git extras (archive, branch rename, commit extras, diff/merge, tag, tree) - Add user service: social (follow/block) - Add internal auth service - Update existing service modules with expanded functionality - Remove deleted IM modules: articles, delivery trace, drafts, follows, messages, polls, presence, reactions, threads
42 lines
1.1 KiB
Rust
42 lines
1.1 KiB
Rust
pub mod archive;
|
|
pub mod blame;
|
|
pub mod branch;
|
|
pub mod branch_rename;
|
|
pub mod commit;
|
|
pub mod commit_extras;
|
|
pub mod commit_extras2;
|
|
pub mod diff;
|
|
pub mod diff_merge_extras;
|
|
pub mod merge;
|
|
pub mod repo_extras;
|
|
pub mod repository;
|
|
pub mod repository_extras;
|
|
pub mod tag;
|
|
pub mod tag_get;
|
|
pub mod tree;
|
|
pub mod tree_extras;
|
|
|
|
use crate::error::AppError;
|
|
use crate::models::repos::Repo;
|
|
use crate::models::workspaces::Workspace;
|
|
use crate::pb::RepoClient;
|
|
use crate::pb::repo::RepositoryHeader;
|
|
use crate::service::RepoService;
|
|
|
|
impl RepoService {
|
|
pub(crate) fn repo_header(&self, repo: &Repo, ws: &Workspace) -> RepositoryHeader {
|
|
RepositoryHeader {
|
|
storage_name: ws.name.clone(),
|
|
relative_path: format!("{}.git", repo.name),
|
|
storage_path: repo.storage_path.clone(),
|
|
}
|
|
}
|
|
|
|
pub(crate) fn git_client(&self, repo: &Repo) -> Result<RepoClient, AppError> {
|
|
self.ctx
|
|
.registry
|
|
.get_git_client(&repo.primary_storage_node_id)
|
|
.ok_or_else(|| AppError::Config("primary git node not available".into()))
|
|
}
|
|
}
|