MCPcopy Create free account
hub / github.com/atomicdotdev/atomic / update_content_index

Function update_content_index

atomic-repository/src/content_search.rs:27–34  ·  view source on GitHub ↗

Incrementally update the content index after file changes. If the repository HEAD has moved since the last full build, this performs a stale-check rebuild. Otherwise the existing index is returned as-is. For finer-grained incremental updates, use [`notify_and_commit`].

(repo_root: &Path)

Source from the content-addressed store, hash-verified

25/// a stale-check rebuild. Otherwise the existing index is returned as-is.
26/// For finer-grained incremental updates, use [`notify_and_commit`].
27pub fn update_content_index(repo_root: &Path) -> Result<(), ContentSearchError> {
28 let config = content_config(repo_root);
29 let index = Index::open(config)?;
30 // rebuild_if_stale returns Ok(Some(stats)) when a rebuild happened,
31 // Ok(None) when the index was already current.
32 let _stats = index.rebuild_if_stale()?;
33 Ok(())
34}
35
36/// Notify the index about a single changed file and commit immediately.
37///

Callers 1

runMethod · 0.85

Calls 1

content_configFunction · 0.85

Tested by

no test coverage detected