Bug Description
get_current_branch() returns empty when no explicit feature/branch is set, and get_feature_paths still prints CURRENT_BRANCH= (empty) even though the feature directory is resolvable from SPECIFY_FEATURE_DIRECTORY or .specify/feature.json. Downstream scripts/agents that expect a non-empty identifier get misleading output.
Steps to Reproduce
- Resolve feature context via SPECIFY_FEATURE_DIRECTORY or .specify/feature.json, without SPECIFY_FEATURE set.
- Run check-prerequisites.sh --paths-only (or call get_feature_paths).
- Inspect CURRENT_BRANCH in the output.
Expected Behavior
A usable identifier (e.g. the feature-directory basename) when there's no branch context.
Actual Behavior
CURRENT_BRANCH is emitted empty.
Specify CLI Version
0.11.0
AI Agent
GitHub Copilot
Operating System
macOS Tahoe 26.5.1
Python Version
3.11.15 (uv-managed standalone CPython, cpython-3.11-macos-aarch64-none — uv installs specify under its own Python, not the system CLT 3.9.6 or Homebrew 3.13/3.14)
Error Logs
none (silent; misleading empty value)
Additional Context
File: .specify/scripts/bash/common.sh (get_current_branch, get_feature_paths). Suggested fix: fall back to the basename of FEATURE_DIR when current_branch is empty. Sibling issues: agent-context scoped layout; feature.json write side-effect.
Bug Description
get_current_branch() returns empty when no explicit feature/branch is set, and get_feature_paths still prints CURRENT_BRANCH= (empty) even though the feature directory is resolvable from SPECIFY_FEATURE_DIRECTORY or .specify/feature.json. Downstream scripts/agents that expect a non-empty identifier get misleading output.
Steps to Reproduce
Expected Behavior
A usable identifier (e.g. the feature-directory basename) when there's no branch context.
Actual Behavior
CURRENT_BRANCH is emitted empty.
Specify CLI Version
0.11.0
AI Agent
GitHub Copilot
Operating System
macOS Tahoe 26.5.1
Python Version
3.11.15 (uv-managed standalone CPython, cpython-3.11-macos-aarch64-none — uv installs
specifyunder its own Python, not the system CLT 3.9.6 or Homebrew 3.13/3.14)Error Logs
none (silent; misleading empty value)Additional Context
File: .specify/scripts/bash/common.sh (get_current_branch, get_feature_paths). Suggested fix: fall back to the basename of FEATURE_DIR when current_branch is empty. Sibling issues: agent-context scoped layout; feature.json write side-effect.