Skip to content

feat: add support for git worktrees - #63

Merged
patrickschroeter merged 1 commit into
mainfrom
dev/worktrees
Aug 7, 2026
Merged

feat: add support for git worktrees#63
patrickschroeter merged 1 commit into
mainfrom
dev/worktrees

Conversation

@patrickschroeter

Copy link
Copy Markdown
Member

Add support for git worktrees (and submodules)

Summary

b5 failed to detect the project root when run from inside a git worktree or submodule. In a normal checkout .git is a directory, but in linked worktrees and submodules it is a file containing a gitdir: pointer to the real git directory. The old detect_git check required .git to be a directory, so path detection silently failed in those setups.

Changes

  • b5/lib/detect.py — detect_git() now accepts .git whether it's a directory (normal checkout) or a file (worktree/submodule), by dropping the os.path.isdir() requirement.
  • b5/tests/lib/test_detect.py — new test module covering normal checkouts, worktrees, the no-git case, and end-to-end project-path detection from a subdirectory of a worktree.
  • CHANGELOG.md — new 1.4.2 entry describing the fix.
  • RELEASE.md — new document describing the release process (version bump, tagging, GitHub Release, automated PyPI publish via GitHub Actions).

@patrickschroeter
patrickschroeter merged commit 7ae49f5 into main Aug 7, 2026
10 checks passed
@patrickschroeter
patrickschroeter deleted the dev/worktrees branch August 7, 2026 07:55
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.

1 participant