ws/ holding a repo and a linked worktree of it as siblings (#4683).
(tmp_path)
| 4688 | |
| 4689 | |
| 4690 | def _git_workspace_with_worktree(tmp_path): |
| 4691 | """ws/ holding a repo and a linked worktree of it as siblings (#4683).""" |
| 4692 | ws = tmp_path / "ws" |
| 4693 | app = ws / "app" |
| 4694 | (app / "src").mkdir(parents=True) |
| 4695 | _git(app, "init", "-q") |
| 4696 | (app / "src" / "a.py").write_text("x = 1\n") |
| 4697 | _git(app, "add", ".") |
| 4698 | _git(app, "-c", "user.name=t", "-c", "user.email=t@t", "commit", "-q", "-m", "init") |
| 4699 | _git(app, "worktree", "add", "-q", str(ws / "app-feature")) |
| 4700 | return ws, app, ws / "app-feature" |
| 4701 | |
| 4702 | |
| 4703 | @pytest.mark.skipif(shutil.which("git") is None, reason="needs git") |
no test coverage detected