mirror of
https://github.com/martinvonz/jj.git
synced 2025-02-04 10:51:37 +00:00
cli: clarify error when trying to forget non-existent workspace
When you try to forget a workspace that doesn't exist, we say "Nothing changed.", since the transaction is empty. Let's have a specific error instead.
This commit is contained in:
parent
62f541e8cd
commit
53b458a601
1 changed files with 8 additions and 0 deletions
|
@ -4007,6 +4007,14 @@ fn cmd_workspace_forget(
|
|||
} else {
|
||||
workspace_command.workspace_id()
|
||||
};
|
||||
if workspace_command
|
||||
.repo()
|
||||
.view()
|
||||
.get_checkout(&workspace_id)
|
||||
.is_none()
|
||||
{
|
||||
return Err(UserError("No such workspace".to_string()));
|
||||
}
|
||||
|
||||
let mut tx =
|
||||
workspace_command.start_transaction(&format!("forget workspace {}", workspace_id.as_str()));
|
||||
|
|
Loading…
Reference in a new issue