Skip to content

Worktree tests miss the design's bare prunable case and two of its three mode-resolution cases #187

Open

Description

@matt-edmondson

What's missing

The worktrees design lists specific parser and builder tests; two parts were not written.

Plan: https://github.com/ktsu-dev/GitIntegration/blob/647dbbc2dcb4e0c46cfd37568b2529f085afcc6a/docs/superpowers/specs/2026-09-21-worktrees-and-github-auth-design.md#L367-L376

Parser tests … locked and prunable each with and without a reason …

Builder tests … One per option, plus three proving the mode field resolves to the last call rather than accumulating -b alongside --detach.

What exists today

  • GitIntegration.Test/Parsing/GitWorktreeParserTests.cs covers locked with and without a reason, but prunable only with a reason (ReadsAPrunableReason). GitWorktreeParser.cs (around L110-112) maps an empty value to null, but that path is untested for prunable.
  • GitIntegration.Test/Builders/GitWorktreeBuilderTests.cs has one mode test, TheLastModeSelectionWins (CreatingBranch → Detached), plus a commit-ish last-wins test.

Why it matters

The mode field is last-call-wins precisely so that -b <name> and --detach never reach git together (git rejects that combination). Only one direction of one pair is tested, so a regression that, say, leaves --detach behind when CreatingBranch is called second, or emits both -b and -B, would pass the suite.

Acceptance criteria

  • Parser: a bare prunable line yields IsPrunable == true and PrunableReason == null.
  • Builder: two more mode-resolution tests, e.g. Detached → CreatingBranch (no --detach in the vector) and CreatingBranch → CreatingOrResettingBranch (-B present, no -b), each asserting the earlier mode's flag and operand are absent.

Dependencies

None. #141 changes the same parser (-z / quoted reasons); either can land first.

Activity

  1. matt-edmondson commented on Oct 7, 2026

    @matt-edmondson
    ContributorAuthor

    Triage


    Generated by Claude Code

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions