feat: more options to clone (#6)

Reviewed-on: https://git.reya.su/reya/signed/pulls/6
This commit was merged in pull request #6.
This commit is contained in:
2026-08-29 03:49:16 +00:00
parent fc796582a8
commit c76ebfb8f6
3 changed files with 181 additions and 19 deletions
+13
View File
@@ -1,3 +1,5 @@
use std::collections::HashSet;
use gpui::SharedString;
use nostr::prelude::*;
@@ -252,6 +254,17 @@ impl Announcement {
}
maintainers
}
/// The `git clone` URLs for this repository, deduplicated while
/// preserving the announced order (deterministic across calls).
pub fn clone_urls(&self) -> Vec<SharedString> {
let mut seen = HashSet::new();
self.clone
.iter()
.map(|url| SharedString::from(format!("git clone {url}")))
.filter(|command| seen.insert(command.clone()))
.collect()
}
}
#[cfg(test)]