cli: Stabilize sort order of inbox repos
Sort repositories before displaying them.
This commit is contained in:
parent
9576a6496b
commit
b477864b83
|
|
@ -28,17 +28,17 @@ $ rad inbox --sort-by id
|
|||
|
||||
``` ~alice
|
||||
$ rad inbox --all --sort-by id
|
||||
╭──────────────────────────────────────────────────────────╮
|
||||
│ radicle-git │
|
||||
├──────────────────────────────────────────────────────────┤
|
||||
│ 3 ● patch Copyright fixes [ ... ] opened now │
|
||||
╰──────────────────────────────────────────────────────────╯
|
||||
╭──────────────────────────────────────────────────────────────╮
|
||||
│ heartwood │
|
||||
├──────────────────────────────────────────────────────────────┤
|
||||
│ 1 ● issue No license file [ .. ] opened now │
|
||||
│ 2 ● branch Change copyright bob/copy created now │
|
||||
╰──────────────────────────────────────────────────────────────╯
|
||||
╭──────────────────────────────────────────────────────────╮
|
||||
│ radicle-git │
|
||||
├──────────────────────────────────────────────────────────┤
|
||||
│ 3 ● patch Copyright fixes [ ... ] opened now │
|
||||
╰──────────────────────────────────────────────────────────╯
|
||||
```
|
||||
|
||||
``` ~alice
|
||||
|
|
|
|||
|
|
@ -201,12 +201,15 @@ fn list_all<'a>(
|
|||
notifs: ¬ifications::StoreReader,
|
||||
storage: &Storage,
|
||||
) -> anyhow::Result<Vec<term::VStack<'a>>> {
|
||||
let mut repos = Vec::new();
|
||||
for repo in storage.repositories()? {
|
||||
let repo = list_repo(repo.rid, sort_by, notifs, storage)?;
|
||||
repos.extend(repo.into_iter());
|
||||
let mut repos = storage.repositories()?;
|
||||
repos.sort_by_key(|r| r.rid);
|
||||
|
||||
let mut vstacks = Vec::new();
|
||||
for repo in repos {
|
||||
let vstack = list_repo(repo.rid, sort_by, notifs, storage)?;
|
||||
vstacks.extend(vstack.into_iter());
|
||||
}
|
||||
Ok(repos)
|
||||
Ok(vstacks)
|
||||
}
|
||||
|
||||
fn list_repo<'a, R: ReadStorage>(
|
||||
|
|
|
|||
Loading…
Reference in New Issue