{"record":{"id":"d63dead02b3eb6d6","repo":"nikivdev/code","slug":"invalid-review-branch-name","errorCode":null,"errorMessage":"Invalid review branch name: {}","messagePattern":"Invalid review branch name: (.+?)","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"src/jj.rs","lineNumber":601,"sourceCode":"        JjWorkspaceAction::Review {\n            branch,\n            path,\n            base,\n            remote,\n            no_fetch,\n        } => {\n            let remote = remote.unwrap_or_else(|| default_remote(&ctx.repo_root));\n            if !no_fetch {\n                ensure_git_not_busy(&ctx.repo_root)?;\n                if let Err(err) = jj_run_in(&ctx.workspace_root, &[\"git\", \"fetch\"]) {\n                    eprintln!(\"⚠ jj git fetch failed: {err}\");\n                    eprintln!(\"  continuing with current local refs\");\n                }\n            }\n\n            let workspace_name = review_workspace_name(&branch);\n            if workspace_name.is_empty() {\n                bail!(\"Invalid review branch name: {}\", branch);\n            }\n\n            let workspace_path = match path {\n                Some(p) => p,\n                None => workspace_default_path(&ctx.repo_root, &workspace_name)?,\n            };\n\n            if let Some(existing_path) =\n                existing_workspace_path(&ctx.workspace_root, &ctx.repo_root, &workspace_name)?\n            {\n                if existing_path != workspace_path {\n                    bail!(\n                        \"Workspace {} already exists at {}\",\n                        workspace_name,\n                        existing_path.display()\n                    );\n                }\n                println!(","sourceCodeStart":583,"sourceCodeEnd":619,"githubUrl":"https://github.com/nikivdev/code/blob/a747e741ae92c09071d0ae946ab48488adcff1ce/src/jj.rs#L583-L619","documentation":"`flow workspace` derives a workspace name from the review branch via review_workspace_name. If that produces an empty string (the branch name is unusable, e.g. empty or malformed), run_workspace bails rather than creating a workspace with an invalid identity.","triggerScenarios":"Calling `flow workspace` (run_workspace) with a review branch whose name normalizes to an empty workspace name — typically an empty or whitespace/symbol-only branch string.","commonSituations":"Passing an empty branch variable from a script; a branch name consisting only of characters the sanitizer strips; forgetting to pass the branch argument so an empty default flows in.","solutions":["Pass a valid review branch name: `flow workspace <valid-branch>`.","Print the branch first (`jj bookmark list`) to confirm it is non-empty and well-formed.","If the name contains odd characters, create or use a sanitized bookmark name."],"exampleFix":"// before\nflow workspace \"\"\n// after\nflow workspace feature/login-fix","handlingStrategy":"validation","validationCode":"// shell\nBRANCH=\"$1\"\n[ -n \"$BRANCH\" ] || { echo \"usage: flow workspace <branch>\" >&2; exit 2; }","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Never pass an empty or shell-unquoted branch variable into flow workspace.","Validate branch names with `jj bookmark list | grep -x \"$BRANCH\"` first.","Quote variables in scripts so stray whitespace doesn't erase the value."],"tags":["cli","validation","workspace","naming"],"backgroundTag":"invalid-branch-name","analyzedSha":"a747e741ae92c09071d0ae946ab48488adcff1ce","analyzedAt":"2026-09-01T22:43:55.719Z","contentChangedAt":null,"schemaVersion":2},"datasetVersion":"2026-09-08T10:18:20.063Z"}