You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Review finding: mismatched review ref is not cleaned up
base_gh_review_fetch compares the fetched commit with the GitHub API head SHA to protect against a force-push between the API read and git fetch. In the mismatch path, the cleanup used the stale API SHA as the git update-ref -d expected old value, even though the namespaced ref already pointed at the fetched commit. That conditional deletion therefore failed and left an orphaned review ref behind.
Impact: a later fetch for the same PR and slug could report that the review checkout already exists, while gh review prune would retain the orphaned ref for manual cleanup.
This is fixed in 09e52e8f: cleanup now uses the ref's actual fetched SHA, and a regression test verifies that both the detached worktree and namespaced ref are removed when the API SHA is stale.
codeforester
deleted the
enhancement/2623-20261020-feat-gh-use-detached-review-worktrees-and-prune-review-refs
branch
October 21, 2026 14:28
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
basectl gh review fetchfor detached PR-review worktrees backed byrefs/base-review/pr/<number>/<slug>.basectl gh review prune, dry-run by default, with ownership, cleanliness, detached-state, ref/head, and current PR-state checks before removal.pr-*refs explicitly out of the permanent workflow; they remain a one-time audited cleanup.Issue
Fixes #2623
Validation
bats cli/bash/commands/basectl/tests/gh-review.batsshellcheck cli/bash/commands/basectl/subcommands/gh_review.shgit diff --checkDocs Impact
docs/github-workflow.md,docs/command-reference.md, and the basectl command README.