From 559f84d9f1739ac7d7a98a1e7431d431639648b7 Mon Sep 17 00:00:00 2001 From: Fintan Halpenny Date: Thu, 19 Oct 2023 10:00:46 +0100 Subject: [PATCH] fetch: inpsect for Cache Add debugging code for inspecting the in-memory Refdb of the Cache. Signed-off-by: Fintan Halpenny X-Clacks-Overhead: GNU Terry Pratchett --- radicle-fetch/src/git/mem.rs | 2 +- radicle-fetch/src/state.rs | 5 +++++ 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/radicle-fetch/src/git/mem.rs b/radicle-fetch/src/git/mem.rs index df53dcb0..598c93c3 100644 --- a/radicle-fetch/src/git/mem.rs +++ b/radicle-fetch/src/git/mem.rs @@ -66,7 +66,7 @@ impl Refdb { } #[allow(dead_code)] - pub(crate) fn print(&self) { + pub(crate) fn inspect(&self) { if self.0.is_empty() { println!("Refdb is empty!"); } else { diff --git a/radicle-fetch/src/state.rs b/radicle-fetch/src/state.rs index 90f95a7b..ac87b196 100644 --- a/radicle-fetch/src/state.rs +++ b/radicle-fetch/src/state.rs @@ -505,6 +505,11 @@ impl<'a, S> Cached<'a, S> { Some(tip) => SignedRefsAt::load_at(*tip, *remote, &self.handle.repo).map(Some), } } + + #[allow(dead_code)] + pub(crate) fn inspect(&self) { + self.state.refs.inspect() + } } impl<'a, S> RemoteRepository for Cached<'a, S> {