Commit 180b1ff
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
| 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 | + | |
| 1474 | + | |
| 1475 | + | |
| 1476 | + | |
| 1477 | + | |
| 1478 | + | |
1462 | 1479 | | |
1463 | 1480 | | |
1464 | 1481 | | |
| |||
0 commit comments