tidy.rs
1use anyhow::Result;
2use std::path::Path;
3
4use crate::db;
5
6pub fn run(root: &Path) -> Result<()> {
7 let store = db::open(root)?;
8 let c = crate::color::stderr_theme();
9 eprintln!(
10 "{}info:{} compacting deltas into snapshot...",
11 c.blue, c.reset
12 );
13 let removed = store.tidy()?;
14 eprintln!("{}info:{} removed {removed} delta file(s)", c.blue, c.reset);
15 Ok(())
16}