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

Function refresh_content_index

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

Refresh the content index for an import, skipping the full rebuild when the existing index is already current (RFC §21 measured budgets, CB-13C AC-3). `rebuild_if_stale` is HEAD-based: a full rebuild stamps the current Git HEAD as the index's `base_commit`, so an import that does not move Git leaves the index current and the next import's refresh is a no-op. Only a missing or unusable index falls

(repo_root: &Path)

Source from the content-addressed store, hash-verified

62/// a missing or unusable index falls back to the full walk-and-rebuild —
63/// which is the cold-import behavior this preserves.
64pub fn refresh_content_index(repo_root: &Path) -> Result<(), ContentSearchError> {
65 match update_content_index(repo_root) {
66 Ok(()) => Ok(()),
67 // Missing or unusable index: fall back to the full walk-and-rebuild
68 // (the cold-import behavior this preserves).
69 Err(_) => build_content_index(repo_root),
70 }
71}
72
73/// Incrementally update the content index after file changes.
74///

Callers 1

run_importMethod · 0.85

Calls 2

update_content_indexFunction · 0.85
build_content_indexFunction · 0.85

Tested by

no test coverage detected