Opens the project store and runs a diff-scoped incremental sync (or a full sync when the diff base is missing / oversized). Returns true on success. `SyncLock` is treated as success (a peer synced). The `TraceDecay` sync/open futures are `Send` (the sync path scopes its `!Send` `gix` values so they drop before every `.await`; see `indexing::stamp_last_synced_commit`), so this awaits them directly
(root: &Path, opts: &TraceDecayOpenOptions, escalation: usize)
| 673 | /// `indexing::stamp_last_synced_commit`), so this awaits them directly on the |
| 674 | /// caller's task under the daemon-wide sync semaphore — no nested runtime. |
| 675 | async fn sync_project(root: &Path, opts: &TraceDecayOpenOptions, escalation: usize) -> bool { |
| 676 | let Ok(cg) = TraceDecay::open_with_options(root, opts.clone()).await else { |
| 677 | return false; |
| 678 | }; |
| 679 | let base = cg.last_synced_commit().await; |
| 680 | let result = match base { |
| 681 | Some(base) => match cg.stale_files_since_commit(&base, escalation) { |
| 682 | Some(files) if files.is_empty() => Ok(()), |
| 683 | Some(files) => cg.sync_if_stale_silent(&files).await, |
| 684 | // Base missing/unreachable or over the escalation limit → full. |
| 685 | None => cg.sync().await.map(|_| ()), |
| 686 | }, |
| 687 | None => cg.sync().await.map(|_| ()), |
| 688 | }; |
| 689 | matches!( |
| 690 | result, |
| 691 | Ok(()) | Err(crate::errors::TraceDecayError::SyncLock { .. }) |
| 692 | ) |
| 693 | } |
| 694 | |
| 695 | /// Proactively tracks a linked worktree's branch. Returns the |
| 696 | /// [`crate::branch::BranchAddOutcome`] name for logging, or `None` on error. |
no test coverage detected