fix: keep bare-repository worktrees non-bare (#2223) · gitpython-developers/GitPython@180b1ff · GitHub
Skip to content

Commit 180b1ff

Browse files
Byroncodex
andcommitted
fix: keep bare-repository worktrees non-bare (#2223)
<!-- agent --> Opening a linked worktree created from a bare repository read `core.bare` from the common repository and discarded the worktree path. Keep a discovered linked worktree non-bare when its administrative directory has a `commondir` marker. The regression compares Git rev-parse behavior and verifies Repo.bare and working_tree_dir. Git baseline: 0bd5a6920d7c4238e0d90ddc0e7e08866e84a0f1; environment.c:is_bare_repository() and setup.c:check_repository_format_gently(). Git 2.50.1 reports the linked checkout as non-bare. Assisted-by: GPT 5.6 Co-authored-by: GPT 5.6 <codex@openai.com>
1 parent 589d8af commit 180b1ff

2 files changed

Lines changed: 21 additions & 0 deletions

File tree

git/repo/base.py

Lines changed: 4 additions & 0 deletions

test/test_repo.py

Lines changed: 17 additions & 0 deletions

0 commit comments

Comments
 (0)