Commit 0993e2e
authored
fix(git): support git clone --bare-backed worktrees (#738)
## Summary
- Detect linked worktrees whose common git directory is a bare repository.
- Resolve those workspaces to the current checkout root so `roborev init` can register Middleman-style worktrees.
- Keep existing behavior for normal linked worktrees and submodule worktrees.
## Validation
- `go fmt ./...`
- `go vet ./...`
- `go test ./...`
- `go test ./internal/git -run 'TestGetMainRepoRootForBareBackedWorktree|TestGetMainRepoRoot' -count=1`\n- Verified `roborev init --no-daemon` from `/Users/mariusvniekerk/.config/middleman/worktrees/github.com/kenn-io/middleman/pr-365` against an isolated patched daemon successfully registers the repo.
Co-authored-by: Marius van Niekerk <mariusvniekerk@users.noreply.github.com>1 parent 5d85920 commit 0993e2e
2 files changed
Lines changed: 31 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
609 | 609 | | |
610 | 610 | | |
611 | 611 | | |
| 612 | + | |
| 613 | + | |
| 614 | + | |
| 615 | + | |
| 616 | + | |
| 617 | + | |
| 618 | + | |
| 619 | + | |
| 620 | + | |
| 621 | + | |
612 | 622 | | |
613 | 623 | | |
614 | 624 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
461 | 461 | | |
462 | 462 | | |
463 | 463 | | |
| 464 | + | |
| 465 | + | |
| 466 | + | |
| 467 | + | |
| 468 | + | |
| 469 | + | |
| 470 | + | |
| 471 | + | |
| 472 | + | |
| 473 | + | |
| 474 | + | |
| 475 | + | |
| 476 | + | |
| 477 | + | |
| 478 | + | |
| 479 | + | |
| 480 | + | |
| 481 | + | |
| 482 | + | |
| 483 | + | |
| 484 | + | |
464 | 485 | | |
465 | 486 | | |
466 | 487 | | |
| |||
0 commit comments