Repository navigation
fix(branch): refuse an empty --github, --jira, --linear or --clickup (#363) - #371
Conversation
…363) An empty value (`--github ""`, `--github=`) parsed to "", which every truthiness test in run() read as "flag not given", so the run went on as a plain branch or blamed --assign/--start/--dry-run for a missing issue flag. It now exits 2 with invalid_value, as an empty --issue already does. Closes #363
There was a problem hiding this comment.
code-reviewer: minor issues
This change makes worktree branch refuse an empty or whitespace-only --github, --jira, --linear or --clickup with exit 2 and invalid_value. It does so right after the several-flags check and before the --assign, --start and --dry-run checks, so those no longer misreport a given flag as missing. The logic is correct: a bare --linear still carries the non-empty LINEAR_PICK token, so the picker is unaffected. The docs and changeset match the code. I have two small suggestions and nothing blocking.
Reviewed e2248f3 for baldurpan · claude-opus-5-5 · 4 files · $0.29
… early An empty --clickup was told to pass a URL, which it refuses; each flag's refusal now names what that flag takes. An empty --issue is refused in the same loop, before the brief is read and before the fetch. Refs #363
There was a problem hiding this comment.
code-reviewer follow-up: looks good
Since the last review, each empty issue flag now gets a message naming what it takes (--clickup asks for the task's id, with no URL). Empty --issue has also moved into the same loop, so it is refused before the brief is read and before gitFetch(); the later block only trims, and a new test checks that no fetch happens. Both earlier comments are dealt with and I found nothing new; the change looks ready.
Earlier comments
- Fixed; yours to resolve: Suggestion: Generic message tells ClickUp users to pass a URL, which
--clickuprefuses - Fixed; yours to resolve: Suggestion: Fold the empty
--issuecheck into this loop so it is refused before the fetch too
Reviewed 27cb9f4 (changes since e2248f3) for baldurpan · claude-opus-5-5 · 2 files · $0.18
Closes #363
What changed
worktree branchnow refuses an empty--github,--jira,--linearor--clickup("",=, or whitespace only), exiting2withinvalid_value— the same as an empty--issue. Before, the empty string read as "flag not given": the run went on as a plain branch, or said--assign/--start/--dry-runneeded an issue flag that was there.src/commands/branch.ts— the refusal sits after the several-flags check (so an empty tracker flag beside--issueis still "several") and before the--assign/--start/--dry-runchecks. A bare--linearstill opens the picker.src/commands/branch.test.ts— each of the four flags, a whitespace-only value, and an empty--githubwith--assign,--startand--dry-run.docs/src/content/docs/commands/branch.mdx— theinvalid_valuerow names the four flags..changeset/empty-tracker-flag.md— patch (confirmed).Gates
pnpm check,pnpm typecheck,pnpm --filter docs typecheck,pnpm build,pnpm docs:build,pnpm --filter docs worker:bundle-check,pnpm docs:audit-dist(29 pages pass),pnpm test(4137 passed),pnpm docs:test(1657 passed).--github=/-l ""reaching""is read from code, not tested end to end; the new tests sit in the--issuedescribe block; the message is generic for ClickUp ids; an empty--issueis still refused after the fetch (predates this change).