diff --git a/lib/src/id_prefix.rs b/lib/src/id_prefix.rs
index 44c4e7a1f..cd13782c4 100644
--- a/lib/src/id_prefix.rs
+++ b/lib/src/id_prefix.rs
@@ -145,6 +145,11 @@ pub struct IdPrefixIndex<'a> {
}
impl IdPrefixIndex<'_> {
+ /// Returns an empty index that just falls back to a provided `repo`.
+ pub const fn empty() -> IdPrefixIndex<'static> {
+ IdPrefixIndex { indexes: None }
+ }
+
/// Resolve an unambiguous commit ID prefix.
pub fn resolve_commit_prefix(
&self,
diff --git a/lib/src/revset.rs b/lib/src/revset.rs
index 73b36704a..5d9693882 100644
--- a/lib/src/revset.rs
+++ b/lib/src/revset.rs
@@ -41,6 +41,7 @@ use crate::fileset::FilesetExpression;
use crate::graph::GraphEdge;
use crate::hex_util::to_forward_hex;
use crate::id_prefix::IdPrefixContext;
+use crate::id_prefix::IdPrefixIndex;
use crate::object_id::HexPrefix;
use crate::object_id::PrefixResolution;
use crate::op_store::RemoteRefState;
@@ -1624,11 +1625,10 @@ impl PartialSymbolResolver for CommitPrefixResolver<'_> {
symbol: &str,
) -> Result