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

Function update_content_index

atomic-repository/src/content_search.rs:54–61  ·  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

52/// a stale-check rebuild. Otherwise the existing index is returned as-is.
53/// For finer-grained incremental updates, use [`notify_and_commit`].
54pub fn update_content_index(repo_root: &Path) -> Result<(), ContentSearchError> {
55 let config = content_config(repo_root);
56 let index = Index::open(config)?;
57 // rebuild_if_stale returns Ok(Some(stats)) when a rebuild happened,
58 // Ok(None) when the index was already current.
59 let _stats = index.rebuild_if_stale()?;
60 Ok(())
61}
62
63/// Notify the index about a single changed file and commit immediately.
64///

Callers 1

runMethod · 0.85

Calls 1

content_configFunction · 0.85

Tested by

no test coverage detected