Skip to content

fix(branch): refuse an empty --github, --jira, --linear or --clickup (#363) - #371

Merged
baldurpan merged 2 commits into
mainfrom
fix/363-branch-an-empty-github-jira-linear-or-clickup-is
Nov 25, 2026
Merged

baldurpan merged 2 commits into
mainfrom
fix/363-branch-an-empty-github-jira-linear-or-clickup-is

Conversation

@baldurpan

Copy link
Copy Markdown
Contributor

Closes #363

What changed

worktree branch now refuses an empty --github, --jira, --linear or --clickup ("", =, or whitespace only), exiting 2 with invalid_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-run needed an issue flag that was there.

  • src/commands/branch.ts — the refusal sits after the several-flags check (so an empty tracker flag beside --issue is still "several") and before the --assign/--start/--dry-run checks. A bare --linear still opens the picker.
  • src/commands/branch.test.ts — each of the four flags, a whitespace-only value, and an empty --github with --assign, --start and --dry-run.
  • docs/src/content/docs/commands/branch.mdx — the invalid_value row names the four flags.
  • .changeset/empty-tracker-flag.md — patch (confirmed).

Gates

  • Gate 1: 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).
  • Gate 2: reviewer subagent, PASS WITH NOTES, nothing blocking. Notes: no test with a positional branch name (refusal runs before it is read); oclif parsing is mocked, so --github= / -l "" reaching "" is read from code, not tested end to end; the new tests sit in the --issue describe block; the message is generic for ClickUp ids; an empty --issue is still refused after the fetch (predates this change).

…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

@baldurs-reviewer baldurs-reviewer Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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

Comment thread src/commands/branch.ts Resolved
Comment thread src/commands/branch.ts Resolved
… 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

@baldurs-reviewer baldurs-reviewer Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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


Reviewed 27cb9f4 (changes since e2248f3) for baldurpan · claude-opus-5-5 · 2 files · $0.18

@baldurpan
baldurpan merged commit beb95ca into main Nov 25, 2026
2 checks passed
@baldurpan
baldurpan deleted the fix/363-branch-an-empty-github-jira-linear-or-clickup-is branch November 25, 2026 11:45
@baldurpan baldurpan mentioned this pull request Nov 25, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

branch: an empty --github, --jira, --linear or --clickup is treated as no issue flag

1 participant