Commit d3cb53c
fix: keep bare-repository worktrees non-bare (#2223)
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.
Validation: 12 focused repository discovery/worktree tests and 7 test_base.py tests passed; ruff check, ruff format --check, and codespell passed.1 parent 589d8af commit d3cb53c
2 files changed
Lines changed: 16 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
386 | 386 | | |
387 | 387 | | |
388 | 388 | | |
| 389 | + | |
| 390 | + | |
| 391 | + | |
| 392 | + | |
389 | 393 | | |
390 | 394 | | |
391 | 395 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1459 | 1459 | | |
1460 | 1460 | | |
1461 | 1461 | | |
| 1462 | + | |
| 1463 | + | |
| 1464 | + | |
| 1465 | + | |
| 1466 | + | |
| 1467 | + | |
| 1468 | + | |
| 1469 | + | |
| 1470 | + | |
| 1471 | + | |
| 1472 | + | |
| 1473 | + | |
1462 | 1474 | | |
1463 | 1475 | | |
1464 | 1476 | | |
| |||
0 commit comments