Skip to content

refactor(git): centralize linked-worktree validity checks - #580

Open
codeforester wants to merge 1 commit into
mainfrom
enhancement/579-20261019-refactor-git-centralize-linked-worktree-validity-checks
Open

codeforester wants to merge 1 commit into
mainfrom
enhancement/579-20261019-refactor-git-centralize-linked-worktree-validity-checks

Conversation

@codeforester

Copy link
Copy Markdown
Collaborator

Fixes #579

Summary

  • add base_git_worktree_path_is_valid as the shared linked-worktree validity predicate
  • distinguish valid linked and detached worktrees from ordinary repositories, missing paths, and stale Git worktree metadata
  • add focused BATS coverage for spaced paths, detached worktrees, ordinary clones, stale metadata, and diagnostics
  • document and publish the API through the manifest, generated reference, v2 contract, and symbol map
  • make the release-tree compatibility check validate the historical manifest so additive stable v2 APIs do not have to exist in the v2.0.0 tree

Issue

Fixes #579; follows the design-level follow-up from basefoundry/base#2621.

Validation

  • bats lib/bash/git/tests/lib_git.bats
  • ./tests/validate.sh
  • tests/lint-warnings.sh
  • scripts/api-manifest check
  • git diff --check

API Impact

Adds the stable base_git_worktree_path_is_valid <path> Git helper. It returns 0 only for a valid linked worktree, 1 for ordinary, missing, or stale paths, and 2 for usage errors. It is read-only and suppresses Git diagnostics for false predicates.

Demo Impact: None.

AI context: unchanged; reusable library contract only.

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

refactor(git): centralize linked-worktree validity checks

1 participant