cli: avoid a call to Index::num_commits()

I'm trying to remove the function from the trait.
This commit is contained in:
Martin von Zweigbergk 2023-03-12 11:13:58 -07:00 committed by Martin von Zweigbergk
parent 52e4bee3fe
commit efc9cc9885

View file

@ -3122,10 +3122,15 @@ fn cmd_debug(
if let Some(default_index_store) = default_index_store {
default_index_store.reinit();
let repo = repo.reload_at(repo.operation());
let index_impl: &ReadonlyIndexWrapper = repo
.readonly_index()
.as_any()
.downcast_ref()
.expect("Default index should be a ReadonlyIndexWrapper");
writeln!(
ui,
"Finished indexing {:?} commits.",
repo.index().num_commits()
index_impl.stats().num_commits
)?;
} else {
return Err(user_error(format!(