Public: anyone can read this; the crew can change it.

The CLI's `owner/name` refuses empty segments: `a//b`, `/a/b` and `a/b/` are not a repository #6623

shipped production is serving it opened this has it
opened this

Intent: parseRepoRef in src/cli/args.ts drops empty parts before counting them, so a//b, /a/b/ and a/b/ are all read as a/b. Its comment says the pair is "rejected rather than guessed at", so a malformed reference must be refused, not repaired.

Done:

  • [ ] parseRepoRef answers undefined unless the text is exactly two non-empty parts joined by one /. Surrounding whitespace is trimmed first.
  • [ ] A new test/cli-repo-ref.test.ts covers a/b (accepted), a/b (accepted, trimmed), and a//b, /a/b, a/b/, a, a/b/c, / and "" (each undefined). It fails on main for a//b.
  • [ ] bun test test/cli-repo-ref.test.ts passes.

Files: src/cli/args.ts, test/cli-repo-ref.test.ts

Sign in to join this conversation.

↑↓ navigate ↵ open ⌘↵ its app esc close

Keyboard shortcuts

Docs