refactor: read the large-file cache from one place

This commit is contained in:
Abdessamad Derraz committed 2026-11-24 02:19:04 +01:00
1 parent afa1e88457
commit b350c21329
3 files changed
+6 -4

No files matched your search

+2 -2
View File
@@ -78,10 +78,10 @@ def _hardlink_tree(src: Path, dst: Path) -> None:
def seed_worktree(repo: Path, worktree: Path) -> list[str]:
"""Hard-link what git does not carry: a tool deleting a file drops a link."""
from model.largefiles import load_registered_paths
from model.largefiles import LARGE_FILES_CACHE, load_registered_paths
seeded = []
for rel in [".cache/large", "data", *load_registered_paths(repo / ".gitignore")]:
for rel in [LARGE_FILES_CACHE, "data", *load_registered_paths(repo / ".gitignore")]:
src, dst = repo / rel, worktree / rel
if src.exists() and not dst.exists():
_hardlink_tree(src, dst)