diff --git a/cli/src/commands/operation/abandon.rs b/cli/src/commands/operation/abandon.rs index 3d252c45e..d337b399f 100644 --- a/cli/src/commands/operation/abandon.rs +++ b/cli/src/commands/operation/abandon.rs @@ -21,7 +21,7 @@ use jj_lib::op_walk; use jj_lib::operation::Operation; use crate::cli_util::{short_operation_hash, CommandHelper}; -use crate::command_error::{user_error, user_error_with_hint, CommandError}; +use crate::command_error::{cli_error, user_error, user_error_with_hint, CommandError}; use crate::ui::Ui; /// Abandon operation history @@ -55,7 +55,7 @@ pub fn cmd_op_abandon( // with the current head. let head_op_str = &command.global_args().at_operation; if head_op_str != "@" { - return Err(user_error("--at-op is not respected")); + return Err(cli_error("--at-op is not respected")); } let current_head_op = op_walk::resolve_op_for_load(repo_loader, head_op_str)?; let resolve_op = |op_str| op_walk::resolve_op_at(op_store, ¤t_head_op, op_str); diff --git a/cli/tests/test_operations.rs b/cli/tests/test_operations.rs index 86d1fbf27..609d4db53 100644 --- a/cli/tests/test_operations.rs +++ b/cli/tests/test_operations.rs @@ -418,7 +418,7 @@ fn test_op_abandon_ancestors() { "###); // Can't create concurrent abandoned operations explicitly. - let stderr = test_env.jj_cmd_failure(&repo_path, &["op", "abandon", "--at-op=@-", "@"]); + let stderr = test_env.jj_cmd_cli_error(&repo_path, &["op", "abandon", "--at-op=@-", "@"]); insta::assert_snapshot!(stderr, @r###" Error: --at-op is not respected "###);