You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Treat GIT_BRANCH_NAME naming the current branch as a no-op - #5006
With GIT_BRANCH_NAME set to the branch that is already checked out, git checkout -b fails, so the feature-branch script reported "Branch already exists" and exited 1 unless --allow-existing-branch was passed. The branch is already in the requested state, so the bash, PowerShell and Python scripts now succeed without switching, as the --allow-existing-branch path does. A GIT_BRANCH_NAME naming a different existing branch still fails.
Testing
Existing and new tests in the git extension suites: 129 passed, 0 failed (the new tests fail without the fix). I did not run the other checks.
Tested locally with uv run specify --help
Ran existing tests with uv sync && uv run pytest
Tested with a sample project (if applicable)
AI Disclosure
I did not use AI assistance for this contribution
I did use AI assistance (fill in the disclosure below)
AI disclosure: Code and tests written by Claude Code (model: Claude Sonnet 5.5, autonomous), reviewed by two further agent passes.
Assisted-by: Claude Code (model: Claude Sonnet 5.5, autonomous)
When GIT_BRANCH_NAME names the branch that is already checked out,
`git checkout -b` fails and the script reported "Branch already exists"
and exited 1, unless --allow-existing-branch was passed. The branch is
already in the requested state, so handle it the way the
--allow-existing-branch path does and succeed without switching.
Applied to the bash, PowerShell and Python scripts. A GIT_BRANCH_NAME
naming a different existing branch still fails.
Fixesgithub#5003
Assisted-by: Claude Code (model: Claude Sonnet 5.5, autonomous)
Add a PowerShell twin of the bash test for GIT_BRANCH_NAME naming the
checked-out branch, use a case-sensitive comparison in the new
PowerShell clause so a differently-cased branch is not mistaken for the
current one, and document the behaviour in speckit.git.feature.md.
Assisted-by: Claude Code (model: Claude Sonnet 5.5, autonomous)
…g branch
Mirror the Python parity negative test: without -AllowExistingBranch, a
GIT_BRANCH_NAME naming a different existing branch must exit 1, report
that the branch already exists, and leave HEAD unchanged.
Assisted-by: Claude Code (model: Claude Sonnet 5.5, autonomous)
Pushed 83df0e0: the PowerShell counterpart of the different-existing-branch test (exit 1, "already exists", HEAD unchanged). With pwsh 7.6.7, tests/extensions/git passes 181/181. On Windows PowerShell 5.1: the script change is one condition built from -or, -and, -ceq and $env:, all available in 5.1; I have no 5.1 host to run it on.
This changes the bundled git extension, but extensions/git/extension.yml and its extensions/catalog.json entry still declare 1.0.1. The version guard rejects content changes without a version increase (.github/scripts/check_extension_version_bump.py:172–177). Existing installs also will not be offered the fix because updates are version-driven, as documented in extensions/EXTENSION-DEVELOPMENT-GUIDE.md:631–637.
Please bump both versions to 1.0.2 and update the pinned version assertion in tests/extensions/git/test_git_extension.py:148.
AI disclosure: GitHub Copilot (model: unknown, autonomous), acting for the requesting contributor; analysis and this comment are AI-generated.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
triage-must-haveVerdict: high-value, important work for Spec Kit — do first
3 participants
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fixes #5003.
Description
With
GIT_BRANCH_NAMEset to the branch that is already checked out,git checkout -bfails, so the feature-branch script reported "Branch already exists" and exited 1 unless--allow-existing-branchwas passed. The branch is already in the requested state, so the bash, PowerShell and Python scripts now succeed without switching, as the--allow-existing-branchpath does. AGIT_BRANCH_NAMEnaming a different existing branch still fails.Testing
Existing and new tests in the git extension suites: 129 passed, 0 failed (the new tests fail without the fix). I did not run the other checks.
uv run specify --helpuv sync && uv run pytestAI Disclosure
AI disclosure: Code and tests written by Claude Code (model: Claude Sonnet 5.5, autonomous), reviewed by two further agent passes.
Assisted-by: Claude Code (model: Claude Sonnet 5.5, autonomous)