Repository navigation
[beman-tidy] Support running on a bare repository with worktrees (#186) - #383
Open
neatudarius wants to merge 2 commits into
Open
neatudarius wants to merge 2 commits into
neatudarius wants to merge 2 commits into
Conversation
Contributor
There was a problem hiding this comment.
🟡 Changes recommended
Worktree discovery mishandles quoted or escaped paths and counts missing locked checkouts, causing valid bare-repository setups to be rejected.
2 open issues
What changed in this PR
Extends beman-tidy’s worktree support to accept bare repository paths, building on the default-branch fallback added in #246.
Changes:
- Resolves a bare repository to its sole checked-out worktree.
- Reports an error when no worktree or multiple worktrees are available.
- Adds tests for direct worktree access and bare repositories with zero, one, or multiple worktrees.
| File | Description |
|---|---|
tests/lib/utils/test_git.py |
Adds bare-clone fixtures and worktree resolution tests. |
beman_tidy/lib/utils/git.py |
Adds worktree discovery, bare repository resolution, and targeted error handling. |
Review effort: Balanced
The worktree case was fixed by #246; this resolves a bare repository to its only worktree and reports the worktrees otherwise.
neatudarius
force-pushed
the
issue-186-bare-repo-worktree
branch
from
November 18, 2026 22:39
5ce511d to
774f2b1
Compare
neatudarius
marked this pull request as ready for review
November 18, 2026 22:42
neatudarius
requested review from
JeffGarland,
ednolan,
rishyak and
vickgoodman
as code owners
November 18, 2026 22:42
Member
Author
|
@steve-downey , is this working for you? |
This branch has not been deployed
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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.

Context
refs/remotes/origin/HEADis missing).Updates
beman_tidy/lib/utils/git.py).tests/lib/utils/test_git.py).Notes
open_worktree_repo.Testing
uv run pytest tests/: 160 passed, 28 skipped;uv run ruff check --diff: clean.mainon the stamped exemplar (--require-all) and all 22 libraries.