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

Function update_content_index

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

76/// a stale-check rebuild. Otherwise the existing index is returned as-is.
77/// For finer-grained incremental updates, use [`notify_and_commit`].
78pub fn update_content_index(repo_root: &Path) -> Result<(), ContentSearchError> {
79 let config = content_config(repo_root);
80 let index = Index::open(config)?;
81 // rebuild_if_stale returns Ok(Some(stats)) when a rebuild happened,
82 // Ok(None) when the index was already current.
83 let _stats = index.rebuild_if_stale()?;
84 Ok(())
85}
86
87/// Notify the index about a single changed file and commit immediately.
88///

Callers 2

runMethod · 0.85
refresh_content_indexFunction · 0.85

Calls 2

content_configFunction · 0.85
openFunction · 0.85

Tested by

no test coverage detected