The watcher's sync-execution logic, reproduced faithfully: diff-scope from `last_synced_commit` when possible, else a full sync. This is the exact decision `git_watch::sync_project` makes; testing it here proves the freshness contract without reaching into the crate-private watcher.
(project: &Path, escalation: usize)
| 99 | /// decision `git_watch::sync_project` makes; testing it here proves the freshness |
| 100 | /// contract without reaching into the crate-private watcher. |
| 101 | async fn watcher_sync(project: &Path, escalation: usize) { |
| 102 | let cg = TraceDecay::open(project).await.unwrap(); |
| 103 | match cg.last_synced_commit().await { |
| 104 | Some(base) => match cg.stale_files_since_commit(&base, escalation) { |
| 105 | Some(files) if files.is_empty() => {} |
| 106 | Some(files) => cg.sync_if_stale_silent(&files).await.unwrap(), |
| 107 | None => { |
| 108 | cg.sync().await.unwrap(); |
| 109 | } |
| 110 | }, |
| 111 | None => { |
| 112 | cg.sync().await.unwrap(); |
| 113 | } |
| 114 | } |
| 115 | } |
| 116 | |
| 117 | /// Unhooked `git commit` → the watcher's diff-scoped sync makes the new symbol |
| 118 | /// searchable. |
no test coverage detected