-
Notifications
You must be signed in to change notification settings - Fork 6.6k
Description
Bug Description
The specify command creates a new feature branch, then throws an error saying that the feature branch already exists (even though it was just created by the script itself)
Steps to Reproduce
- On a antigravity ide, choose powershell as the spec bash
- Create a constitution
- Now run the specify command with only a main branch
- It invokes the create_new_feature.ps1 script, then fails
Expected Behavior
It was expected that a new branch will be created and the spec details written in it
Actual Behavior
It failed after branch creation, stalling the agent session and not writing the specification.
Specify CLI Version
0.1.13
AI Agent
Antigravity
Operating System
windows 11
Python Version
3.12..5
Error Logs
`\.specify\scripts\powershell\create-new-featur
e.ps1 : Error: Branch '001-my-project' already exists. Please use a
different feature name or specify a different number with -Number.
At path\to\my\project\.specify\scripts\powershell\create-new-fea
ture.ps1:269 char:13
+ Write-Error "Error: Branch '$branchName' already exists. ...
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ CategoryInfo : NotSpecified: (:) [Write-Error], WriteErrorExceptio
n
+ FullyQualifiedErrorId : Microsoft.PowerShell.Commands.WriteErrorException,c
reate-new-feature.ps1`Additional Context
The issue seems to be in the create_new_feature.ps1 file, line 253.
git checkout -b $branchName 2>$null | Out-Null creates a new branch then throws an exception, leading to later lines thinking branch not created.
In terminal this command has no issue, but in a try catch block of powershell, this raises an exception
The $ErrorActionPreference variable is set to 'continue' (not 'stop') in my environment.
The code sets this to 'stop'
Running the git command in quiet mode (-q) fixes this.