Context
Parent: #160
The showstopper v0.4.0 bug (#142) was diff silently corrupting the disk cache. build_snapshot_from_working_tree() called load_graph(entry, false) — caching enabled — which wrote a reduced git-tree graph to .chainsaw.cache, overwriting the full graph. Subsequent trace/packages returned wrong results.
Expected Behavior
Tests that verify diff operations never read or write the disk cache.
Scope
- Test: run
trace (builds cache), then diff HEAD~1, then trace again — results must match
- Test: after
diff, .chainsaw.cache mtime is unchanged
- Test:
build_snapshot_from_ref() and build_snapshot_from_working_tree() don't touch cache
- Consider a test helper that wraps cache operations with a sentinel file to detect unexpected writes
- Consider a
#[cfg(test)] assertion in load_graph that panics if called with no_cache=false during a diff context
Context
Parent: #160
The showstopper v0.4.0 bug (#142) was
diffsilently corrupting the disk cache.build_snapshot_from_working_tree()calledload_graph(entry, false)— caching enabled — which wrote a reduced git-tree graph to.chainsaw.cache, overwriting the full graph. Subsequenttrace/packagesreturned wrong results.Expected Behavior
Tests that verify diff operations never read or write the disk cache.
Scope
trace(builds cache), thendiff HEAD~1, thentraceagain — results must matchdiff,.chainsaw.cachemtime is unchangedbuild_snapshot_from_ref()andbuild_snapshot_from_working_tree()don't touch cache#[cfg(test)]assertion inload_graphthat panics if called withno_cache=falseduring a diff context