The local vault-init body's recursive tracker: add every file under the vault directory (relative to the repository root).
(
repo: &atomic_repository::Repository,
working_copy: atomic_core::types::WorkingCopyId,
dir: &std::path::Path,
)
| 1207 | /// The local vault-init body's recursive tracker: add every file under |
| 1208 | /// the vault directory (relative to the repository root). |
| 1209 | fn add_vault_files_recursive( |
| 1210 | repo: &atomic_repository::Repository, |
| 1211 | working_copy: atomic_core::types::WorkingCopyId, |
| 1212 | dir: &std::path::Path, |
| 1213 | ) -> Result<(), Status> { |
| 1214 | if let Ok(entries) = std::fs::read_dir(dir) { |
| 1215 | for entry in entries.flatten() { |
| 1216 | let path = entry.path(); |
| 1217 | if path.is_dir() { |
| 1218 | add_vault_files_recursive(repo, working_copy, &path)?; |
| 1219 | } else if path.is_file() { |
| 1220 | if let Ok(relative) = path.strip_prefix(repo.root()) { |
| 1221 | let _ = repo.add( |
| 1222 | working_copy, |
| 1223 | relative, |
| 1224 | atomic_repository::TrackingOptions::default(), |
| 1225 | ); |
| 1226 | } |
| 1227 | } |
| 1228 | } |
| 1229 | } |
| 1230 | Ok(()) |
| 1231 | } |
| 1232 | |
| 1233 | pub(crate) fn response_meta(meta: &Option<RequestMeta>) -> Option<ResponseMeta> { |
| 1234 | meta.as_ref().map(|meta| ResponseMeta { |