wsb 0.275.7622

Workspace tools for every project under $PRJ: git across submodules, template stamping, GitHub, and the workbench
Documentation
use crate::prelude::*;
pub mod session_repo;
pub use session_repo::*;

use crate::persist::global::service::DatabaseService;
use crate::persist::local::repos::catalogue_repo::CatalogueRepo;

/// What the workshop's database holds about one worktree that has a
/// repository of its own: its test catalogue. (Its other row, the workbench
/// layout, is read and written whole by the daemon.)
#[derive(Clone, Debug)]
pub struct WsbRepos {
    /// Every test that exists in the worktree, as rows.
    pub catalogue_repo: Arc<CatalogueRepo>,
}

impl WsbRepos {
    /// The worktree the database names `worktree`
    /// ([`crate::local_state::LocalState::key`]).
    pub fn new(db_service: &Arc<DatabaseService>, worktree: &str) -> Self {
        Self {
            catalogue_repo: Arc::new(CatalogueRepo::new(db_service.clone(), worktree)),
        }
    }

    pub fn catalogue_repo(&self) -> Arc<CatalogueRepo> {
        self.catalogue_repo.clone()
    }
}