fetch: inpsect for Cache

Add debugging code for inspecting the in-memory Refdb of the Cache.

Signed-off-by: Fintan Halpenny <fintan.halpenny@gmail.com>
X-Clacks-Overhead: GNU Terry Pratchett
This commit is contained in:
Fintan Halpenny 2023-10-19 10:00:46 +01:00 committed by cloudhead
parent 0640ea59ec
commit 559f84d9f1
No known key found for this signature in database
2 changed files with 6 additions and 1 deletions

View File

@ -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 {

View File

@ -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> {