chore: refactor backend around domain types (#26)
Rust / build (macos-latest, stable) (push) Canceled after 0s
Rust / build (ubuntu-latest, stable) (push) Canceled after 0s
Rust / build (windows-latest, stable) (push) Canceled after 0s

Reviewed-on: #26
This commit was merged in pull request #26.
This commit is contained in:
2026-10-03 10:35:48 +00:00
parent 6c4cc9f2ca
commit c76e909f7f
63 changed files with 4400 additions and 6235 deletions
+4 -6
View File
@@ -2,20 +2,18 @@ use std::path::{Path, PathBuf};
use ignore::WalkBuilder;
use crate::nip34::{Nip34Binding, detect_nip34};
use crate::nip34::Nip34Binding;
use crate::repo::Repo;
/// Caps nesting so pathological trees can't stall the scan.
// Caps nesting so pathological trees can't stall the scan.
const SCAN_MAX_DEPTH: usize = 12;
/// A git repository discovered under a scan root.
#[derive(Debug, Clone)]
pub struct LocalRepo {
pub path: PathBuf,
/// `None` for a plain repository.
pub nip34: Option<Nip34Binding>,
}
/// Walk `root` recursively and collect the git repositories below it.
pub fn find_git_repos(root: &Path) -> Vec<LocalRepo> {
if !root.is_dir() {
return Vec::new();
@@ -49,7 +47,7 @@ pub fn find_git_repos(root: &Path) -> Vec<LocalRepo> {
roots
.into_iter()
.map(|path| {
let nip34 = detect_nip34(&path);
let nip34 = Repo::open(&path).ok().and_then(|repo| repo.nip34_binding());
LocalRepo { path, nip34 }
})
.collect()