Radish alpha
h
Radicle Heartwood Protocol & Stack
Radicle
Git (anonymous pull)
Log in to clone via SSH
radicle: Return individual results for repo in `repositories_by_id`
✗ CI failure Sebastian Martinez committed 6 months ago
commit a066120e59de612bd2fb7344eab04cb3c526a736
parent c268e809e9dafb9f1d2879fb781d501dbcf61902
1 passed 3 failed (4 total) View logs
1 file changed +7 -7
modified crates/radicle/src/storage/git.rs
@@ -238,9 +238,9 @@ impl Storage {

    pub fn repositories_by_id<'a>(
        &self,
-
        mut rids: impl Iterator<Item = &'a RepoId>,
-
    ) -> Result<Vec<RepositoryInfo>, RepositoryError> {
-
        rids.try_fold(Vec::new(), |mut infos, rid| {
+
        rids: impl Iterator<Item = &'a RepoId>,
+
    ) -> Vec<Result<RepositoryInfo, RepositoryError>> {
+
        rids.map(|rid| {
            let repo = self.repository(*rid)?;
            let (_, head) = repo.head()?;
            let refs = refs::SignedRefsAt::load(self.info.key, &repo)?;
@@ -248,16 +248,16 @@ impl Storage {
                .as_ref()
                .map(|r| SyncedAt::new(r.at, &repo))
                .transpose()?;
-
            let info = RepositoryInfo {
+

+
            Ok(RepositoryInfo {
                rid: *rid,
                head,
                doc: repo.identity_doc()?.into(),
                refs,
                synced_at,
-
            };
-
            infos.push(info);
-
            Ok(infos)
+
            })
        })
+
        .collect()
    }

    pub fn inspect(&self) -> Result<(), RepositoryError> {