mirror of
https://github.com/martinvonz/jj.git
synced 2025-01-19 19:08:08 +00:00
cli: use root operation id as the default lhs operand of range expression
This commit is contained in:
parent
fb3e006a45
commit
c6b1ace9dd
1 changed files with 4 additions and 4 deletions
|
@ -20,6 +20,7 @@ use itertools::Itertools as _;
|
|||
use jj_lib::object_id::ObjectId;
|
||||
use jj_lib::op_store::OperationId;
|
||||
use jj_lib::op_walk;
|
||||
use jj_lib::operation::Operation;
|
||||
use jj_lib::repo::Repo;
|
||||
|
||||
use crate::cli_util::{
|
||||
|
@ -319,10 +320,9 @@ fn cmd_op_abandon(
|
|||
let (abandon_root_op, abandon_head_op) =
|
||||
if let Some((root_op_str, head_op_str)) = args.operation.split_once("..") {
|
||||
let root_op = if root_op_str.is_empty() {
|
||||
// TODO: Introduce a virtual root operation and use it instead.
|
||||
op_walk::walk_ancestors(slice::from_ref(¤t_head_op))
|
||||
.last()
|
||||
.unwrap()?
|
||||
let id = op_store.root_operation_id();
|
||||
let data = op_store.read_operation(id)?;
|
||||
Operation::new(op_store.clone(), id.clone(), data)
|
||||
} else {
|
||||
resolve_op(root_op_str)?
|
||||
};
|
||||
|
|
Loading…
Reference in a new issue