Skip to content
Clone
main
74 lines 1.9 KB Rust
use crate::context::facade::GitContext;
use crate::lfs;
pub use crate::lfs::types::*;
use crate::service::GitService;
use crate::share::errors::GitError;
impl GitService {
pub async fn lfs_download_to<W>(
&self,
_space_name: String,
_repo_name: String,
_oid: String,
_writer: &mut W,
) -> Result<u64, GitError>
where
W: tokio::io::AsyncWrite + Send + Unpin,
{
Err(GitError::Unimplemented(
"LFS object download is served by KenShell",
))
}
pub async fn lfs_lock(
&self,
ctx: &GitContext,
owner: i64,
path: String,
oid: Option<String>,
) -> Result<LfsLock, GitError> {
lfs::create_lock(self, ctx, owner, path, oid).await
}
pub async fn lfs_unlock(
&self,
ctx: &GitContext,
owner: i64,
path: String,
force: bool,
) -> Result<(), GitError> {
lfs::unlock(self, ctx, owner, path, force).await
}
pub async fn lfs_unlock_by_id(
&self,
ctx: &GitContext,
owner: i64,
lock_id: String,
force: bool,
) -> Result<(), GitError> {
lfs::unlock_by_id(self, ctx, owner, lock_id, force).await
}
pub async fn lfs_list_locks(
&self,
ctx: &GitContext,
cursor: Option<String>,
limit: u64,
) -> Result<LfsLockListResponse, GitError> {
lfs::list_locks(self, ctx, cursor, limit).await
}
pub async fn lfs_verify_locks(
&self,
ctx: &GitContext,
caller: i64,
limit: u64,
) -> Result<LfsVerifyLocksResponse, GitError> {
lfs::verify_locks(self, ctx, caller, limit).await
}
pub async fn lfs_cleanup_unreferenced(&self, _ctx: &GitContext) -> Result<i64, GitError> {
Err(GitError::Unimplemented("LFS cleanup is served by KenShell"))
}
}