diff --git a/lib/src/op_walk.rs b/lib/src/op_walk.rs index 4a6a3f2cd..3241f1163 100644 --- a/lib/src/op_walk.rs +++ b/lib/src/op_walk.rs @@ -89,9 +89,17 @@ pub fn resolve_op_with_repo( repo: &ReadonlyRepo, op_str: &str, ) -> Result { - let op_store = repo.op_store(); - let get_current_op = || Ok(repo.operation().clone()); - let get_head_ops = || Ok(vec![repo.operation().clone()]); + resolve_op_at(repo.op_store(), repo.operation(), op_str) +} + +/// Resolves operation set expression at the given head operation. +pub fn resolve_op_at( + op_store: &Arc, + head_op: &Operation, + op_str: &str, +) -> Result { + let get_current_op = || Ok(head_op.clone()); + let get_head_ops = || Ok(vec![head_op.clone()]); resolve_single_op(op_store, get_current_op, get_head_ops, op_str) }