Skip to content

[Bug]: get_feature_paths emits empty CURRENT_BRANCH when SPECIFY_FEATURE unset, despite feature context via SPECIFY_FEATURE_DIRECTORY/feature.json #3026

@athemelis

Description

@athemelis

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

  1. Resolve feature context via SPECIFY_FEATURE_DIRECTORY or .specify/feature.json, without SPECIFY_FEATURE set.
  2. Run check-prerequisites.sh --paths-only (or call get_feature_paths).
  3. 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.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions