From 52430fe5db959dcc23fa965dd7aabcdc29db17a5 Mon Sep 17 00:00:00 2001 From: DanConwayDev Date: Sat, 10 Jan 2026 01:41:31 +0000 Subject: fix: propagate git fetch errors instead of logging misleading success --- src/purgatory/sync/context.rs | 22 +++++----------------- 1 file changed, 5 insertions(+), 17 deletions(-) (limited to 'src') diff --git a/src/purgatory/sync/context.rs b/src/purgatory/sync/context.rs index 4d34c7c..e61de01 100644 --- a/src/purgatory/sync/context.rs +++ b/src/purgatory/sync/context.rs @@ -345,7 +345,7 @@ impl SyncContext for RealSyncContext { let url = url.to_string(); let missing_oids: Vec = missing.into_iter().cloned().collect(); - let fetched = tokio::task::spawn_blocking(move || -> Vec { + tokio::task::spawn_blocking(move || -> Result> { // git fetch ... - fetch all OIDs in one command let mut args = vec!["fetch", "--depth=1", &url]; args.extend(missing_oids.iter().map(|s| s.as_str())); @@ -366,29 +366,17 @@ impl SyncContext for RealSyncContext { debug!(fetched_count = fetched.len(), "Successfully fetched OIDs"); - fetched + Ok(fetched) } Ok(result) => { let stderr = String::from_utf8_lossy(&result.stderr); - debug!( - stderr = %stderr, - "git fetch failed" - ); - vec![] - } - Err(e) => { - debug!( - error = %e, - "git fetch command error" - ); - vec![] + Err(anyhow::anyhow!("git fetch failed: {}", stderr)) } + Err(e) => Err(anyhow::anyhow!("git fetch command error: {}", e)), } }) .await - .map_err(|e| anyhow::anyhow!("Failed to spawn blocking task: {}", e))?; - - Ok(fetched) + .map_err(|e| anyhow::anyhow!("Failed to spawn blocking task: {}", e))? } async fn process_newly_available_git_data( -- cgit v1.2.3