Expand paths relative to $BLOBDIR into absolute paths. If `path` starts with "$BLOBDIR", replaces it with the blobdir path. Otherwise, returns path as is.
(context: &Context, path: &Path)
| 340 | /// If `path` starts with "$BLOBDIR", replaces it with the blobdir path. |
| 341 | /// Otherwise, returns path as is. |
| 342 | pub(crate) fn get_abs_path(context: &Context, path: &Path) -> PathBuf { |
| 343 | if let Ok(p) = path.strip_prefix("$BLOBDIR") { |
| 344 | context.get_blobdir().join(p) |
| 345 | } else { |
| 346 | path.into() |
| 347 | } |
| 348 | } |
| 349 | |
| 350 | pub(crate) async fn get_filebytes(context: &Context, path: &Path) -> Result<u64> { |
| 351 | let path_abs = get_abs_path(context, path); |
no test coverage detected