haematite-cli 0.21.8

The haematite command: serve a store, its door and Studio, answer MCP, query with jq, and host the store's assistant seat
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
//! STOR-003 MD5a-t: a served store's branch references, opened as its
//! storage opened them, keeping `keep` previous versions. A helper that
//! commits or advances a record there opens them through this, with the K its
//! test's storage stated, never without one.

use std::error::Error;
use std::path::Path;

use haematite::branch::{KeptLimit, RefStore};
use haematite::db::vacuum::CANONICAL_REFS_DIR;

pub fn open_refs(data: &Path, keep: usize) -> Result<RefStore, Box<dyn Error>> {
    let mut refs = RefStore::open(data.join(CANONICAL_REFS_DIR))?;
    refs.keep_versions(KeptLimit::new(keep)?);
    Ok(refs)
}