From d78d3a86ba81a5b59cde527a448f5c9d131db8d6 Mon Sep 17 00:00:00 2001 From: DanConwayDev Date: Wed, 7 Jan 2026 12:34:59 +0000 Subject: Refactor handle_receive_pack to use unified process_newly_available_git_data Replace ~100 lines of duplicated post-push processing in handle_receive_pack with a single call to the unified process_newly_available_git_data function. The unified function handles all post-git-data-available processing: - Discovering satisfiable events from purgatory (state and PR events) - Syncing OIDs to authorized owner repos - Aligning refs (+ setting HEAD) in all owner repos - Saving events to database - Notifying WebSocket subscribers - Removing from purgatory This ensures consistent behavior regardless of how git data arrives (git push vs purgatory sync fetching from remote servers). Also mark test-only internal methods with #[cfg(test)] to silence dead code warnings. --- src/purgatory/sync/throttle.rs | 2 ++ 1 file changed, 2 insertions(+) (limited to 'src/purgatory/sync') diff --git a/src/purgatory/sync/throttle.rs b/src/purgatory/sync/throttle.rs index a310a91..05b0878 100644 --- a/src/purgatory/sync/throttle.rs +++ b/src/purgatory/sync/throttle.rs @@ -343,6 +343,7 @@ impl ThrottleManager { /// /// Decrements in-flight count and cleans up old timestamps. /// Does not trigger processing of queued identifiers. + #[cfg(test)] fn complete_request_internal(&self, domain: &str) { if let Some(entry) = self.throttles.get(domain) { let mut throttle = entry.lock().unwrap(); @@ -377,6 +378,7 @@ impl ThrottleManager { /// /// If the identifier is already queued for this domain, merges the tried_urls sets. /// Does not trigger processing. + #[cfg(test)] fn enqueue_identifier_internal( &self, domain: &str, -- cgit v1.2.3