Skip to content

Commit

Permalink
revset: clarify error about missing working-copy commit for workspace
Browse files Browse the repository at this point in the history
The error message that says something like 'Workspace "default"
doesn't have a working copy' confused me when I saw it. The problem
it's describing is that the repo view doesn't have a working-copy
commit for the given workspace id. Saying "working-copy commit"
instead of "working copy" hopefully clarifies it a bit.
  • Loading branch information
martinvonz committed Jun 19, 2024
1 parent 3e7ad4d commit a309e49
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion cli/tests/test_workspaces.rs
Original file line number Diff line number Diff line change
Expand Up @@ -643,7 +643,7 @@ fn test_workspaces_forget() {
// Revision "@" cannot be used
let stderr = test_env.jj_cmd_failure(&main_path, &["log", "-r", "@"]);
insta::assert_snapshot!(stderr, @r###"
Error: Workspace "default" doesn't have a working copy
Error: Workspace "default" doesn't have a working-copy commit
"###);

// Try to add back the workspace
Expand Down
2 changes: 1 addition & 1 deletion lib/src/revset.rs
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ pub enum RevsetResolutionError {
name: String,
candidates: Vec<String>,
},
#[error("Workspace \"{name}\" doesn't have a working copy")]
#[error("Workspace \"{name}\" doesn't have a working-copy commit")]
WorkspaceMissingWorkingCopy { name: String },
#[error("An empty string is not a valid revision")]
EmptyString,
Expand Down

0 comments on commit a309e49

Please sign in to comment.