Skip to content

fix(pr-branch): sub_repos from config silently ignored — git commands run on root repo #666

@fleizean

Description

@fleizean

Bug Description

/gsd:pr-branch ignores sub-repos defined in planning.sub_repos config. All git commands inside the sub-repo handling path run without a -C <repo> flag, so they operate on the shell's current working directory (the root repo) instead of the intended sub-repo.

Steps to Reproduce

  1. Set up a project with planning.sub_repos: ["backend", "frontend"] in .planning/config.json
  2. Make uncommitted changes inside one of the sub-repos (e.g. backend/)
  3. Run /gsd:pr-branch
  4. Observe: sub-repos are never scanned; no PR is created for backend/

Expected Behavior

For each sub-repo in planning.sub_repos:

  • git -C "$REPO" status --porcelain detects uncommitted changes
  • User is prompted to handle all / select / skip
  • Selected repos get a branch created, changes committed, pushed, and a companion PR opened

Actual Behavior

Sub-repos are silently skipped. Git commands were being called without -C <repo>, so they operated on the root repo's working directory.

Root Cause

The pr-branch workflow lacked a handle_sub_repos step. Git commands were not scoped with git -C <repo> — relying on cd which does not persist shell state between agent-executed commands.

Environment

  • GSD Version: current next branch
  • Runtime: Claude Code
  • OS: macOS

Metadata

Metadata

Assignees

No one assigned

    Labels

    area: commandsSlash commandsarea: workflowPhase execution, ROADMAP, STATE.mdbugSomething isn't workingconfirmed-bugVerified reproducible bugfix-pendingFix submitted, awaiting merge

    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