feat: projects and worktree management (#62)

This commit is contained in:
banteg
2026-01-07 17:45:05 +04:00
committed by GitHub
parent 1178b738df
commit aa078258ea
28 changed files with 1735 additions and 144 deletions
+17 -1
View File
@@ -2,7 +2,12 @@ from __future__ import annotations
from pathlib import Path
from takopi.utils.paths import relativize_command, relativize_path
from takopi.utils.paths import (
relativize_command,
relativize_path,
reset_run_base_dir,
set_run_base_dir,
)
def test_relativize_command_rewrites_cwd_paths(tmp_path: Path) -> None:
@@ -33,3 +38,14 @@ def test_relativize_path_inside_base(tmp_path: Path) -> None:
base.mkdir()
value = str(base / "src" / "app.py")
assert relativize_path(value, base_dir=base) == "src/app.py"
def test_relativize_path_uses_run_base_dir(tmp_path: Path) -> None:
base = tmp_path / "repo"
base.mkdir()
token = set_run_base_dir(base)
try:
value = str(base / "src" / "app.py")
assert relativize_path(value) == "src/app.py"
finally:
reset_run_base_dir(token)