Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 5 additions & 2 deletions ceres/src/lfs/handler.rs
Original file line number Diff line number Diff line change
Expand Up @@ -177,7 +177,10 @@ pub async fn lfs_delete_lock(
}
}

/// Process batch request.
///
///
/// Reference:
/// 1. [Git LFS Batch API](https://github.com/git-lfs/git-lfs/blob/main/docs/api/batch.md)
pub async fn lfs_process_batch(
config: &LfsConfig,
mut batch_vars: BatchRequest,
Expand All @@ -197,7 +200,7 @@ pub async fn lfs_process_batch(
let found = meta.is_ok();
let mut meta = meta.unwrap_or_default();
if found && lfs_file_exist(config, &meta).await {
// originla download method, split mode use ``
// original download method, split mode use ``
response_objects.push(represent(object, &meta, batch_vars.operation == "download", false, false, &server_url).await);
continue;
}
Expand Down
15 changes: 11 additions & 4 deletions mono/src/server/https_server.rs
Original file line number Diff line number Diff line change
Expand Up @@ -173,15 +173,22 @@ pub async fn app(config: Config, host: String, port: u16, common: CommonOptions)
}

lazy_static! {
//GET
/// The [LFS Server Discovery](https://github.com/git-lfs/git-lfs/blob/main/docs/api/server-discovery.md)
/// document describes the server LFS discovery protocol.
///
/// The following regular expressions are used to match the LFS server discovery protocol.
///
static ref OBJECTS_REGEX: Regex = Regex::new(r"/objects/[a-z0-9]+$").unwrap();
static ref LOCKS_REGEX: Regex = Regex::new(r"/locks$").unwrap();
static ref INFO_REFS_REGEX: Regex = Regex::new(r"/info/refs$").unwrap();
//POST

static ref REGEX_LOCKS_VERIFY: Regex = Regex::new(r"/locks/verify$").unwrap();
static ref REGEX_UNLOCK: Regex = Regex::new(r"/unlock$").unwrap();
static ref REGEX_OBJECTS_BATCH: Regex = Regex::new(r"/objects/batch$").unwrap();
static ref REGEX_OBJECTS_CHUNKIDS: Regex = Regex::new(r"objects/chunkids$").unwrap();

static ref REGEX_OBJECTS_CHUNKIDS: Regex = Regex::new(r"/objects/chunkids$").unwrap();

/// Git Protocol
static ref INFO_REFS_REGEX: Regex = Regex::new(r"/info/refs$").unwrap();
static ref REGEX_GIT_UPLOAD_PACK: Regex = Regex::new(r"/git-upload-pack$").unwrap();
static ref REGEX_GIT_RECEIVE_PACK: Regex = Regex::new(r"/git-receive-pack$").unwrap();
}
Expand Down