fix: support Repo() autodiscovery from linked worktree GIT_DIR · gitpython-developers/GitPython@3a94f7c · GitHub
Skip to content

Commit 3a94f7c

Browse files
committed
fix: support Repo() autodiscovery from linked worktree GIT_DIR
Handle linked worktree git directories when GIT_DIR points to .git/worktrees/<name>. Previously Repo() could fail with InvalidGitRepositoryError in this scenario, while Repo(os.getcwd()) worked correctly. Add regression test to cover autodiscovery in linked worktrees.
1 parent 75e6c6b commit 3a94f7c

2 files changed

Lines changed: 53 additions & 0 deletions

File tree

git/repo/base.py

Lines changed: 22 additions & 0 deletions

test/test_repo.py

Lines changed: 31 additions & 0 deletions

0 commit comments

Comments
 (0)