From e936757d6364dbcdbca3c301755d36e1814f4d61 Mon Sep 17 00:00:00 2001 From: Harnoor Lal Date: Sun, 22 Feb 2026 12:25:03 -0800 Subject: [PATCH] fix(cache): prevent diff from corrupting disk cache --- src/main.rs | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/main.rs b/src/main.rs index 2b664a9..63fc0c6 100644 --- a/src/main.rs +++ b/src/main.rs @@ -659,13 +659,17 @@ fn build_snapshot_from_ref( } /// Build a snapshot from the current working tree. +/// +/// Uses `no_cache=true` to avoid polluting the disk cache — the "before" +/// side of a diff may have written a reduced (git-tree-only) graph, and +/// the working-tree snapshot must not read or overwrite that entry. fn build_snapshot_from_working_tree( entry: &Path, quiet: bool, sc: report::StderrColor, ) -> Result { let start = Instant::now(); - let (loaded, _cache_write) = loader::load_graph(entry, false)?; + let (loaded, _cache_write) = loader::load_graph(entry, true)?; if !quiet { print_build_status(&loaded, start, sc); }