MCPcopy Create free account
hub / github.com/AI45Lab/Code / join_workspace_path

Function join_workspace_path

core/src/workspace/s3.rs:968–974  ·  view source on GitHub ↗

Join `base` and a key relative to its S3 prefix into a workspace-relative [`WorkspacePath`]. Handles the "base is root" case so the result does not start with `./`.

(base: &WorkspacePath, rel: &str)

Source from the content-addressed store, hash-verified

966/// [`WorkspacePath`]. Handles the "base is root" case so the result does not
967/// start with `./`.
968fn join_workspace_path(base: &WorkspacePath, rel: &str) -> WorkspacePath {
969 if base.is_root() {
970 WorkspacePath::from_normalized(rel)
971 } else {
972 WorkspacePath::from_normalized(format!("{}/{}", base.as_str(), rel))
973 }
974}
975
976/// Last segment of a slash-separated key, used to apply filename-only glob
977/// filters in `grep` (matches `ignore::types` semantics from the local

Callers 3

globMethod · 0.85
grepMethod · 0.85

Calls 1

is_rootMethod · 0.80