Skip to content
This repository was archived by the owner on Nov 18, 2026. It is now read-only.

fix: reject leading dashes in worktree branch names - #269

Open
harjotgill wants to merge 1 commit into
mainfrom
codex/gtr-leading-dash-branch
Open

harjotgill wants to merge 1 commit into
mainfrom
codex/gtr-leading-dash-branch

Conversation

@harjotgill

@harjotgill harjotgill commented Nov 18, 2026 •

Copy link
Copy Markdown
Contributor

A branch name entered at the interactive prompt can reach Git as an option. The command can then report success for a worktree that did not check out the requested branch. Reject leading dashes during the shared worktree name validation, before fetching, creating a branch, or creating a worktree. This also covers PR checkout and explicit folder overrides.

The new CLI regression reproduces the false success on the v3.1.0 source and passes with the fix. It checks that rejected input leaves the worktree registry and destination untouched. Seven existing cases passed across ordinary creation, branch tracking, literal branch names, and native/fallback PR checkout. ShellCheck on lib/core.sh and git diff --check passed.

Summary by CodeRabbit

  • Bug Fixes
    • The new command now rejects prompted branch names beginning with - and reports an error, preventing unintended worktree changes.

@coderabbitai

coderabbitai Bot commented Nov 18, 2026

Copy link
Copy Markdown

Explain Change →

Note

CodeRabbit ASCII loading animation

Currently processing new changes in this PR. This may take a few minutes, please wait...

Review info

Run configuration

Commits

Reviewing files that changed from the base of the PR and between 18c0b1b and fa2deca.

Files selected for processing: 2

  • lib/core.sh
  • tests/cmd_create_integration.bats

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant