tests/functional2/nix: only convert path to physical if it isn't already

Change-Id: I88e5079ef01872302aade365444d9b028088ff95
This commit is contained in:
Commentator2.0
2026-01-15 16:06:59 +01:00
committed by eldritch horrors
parent 042a147aff
commit 8f474399f5
+5 -1
View File
@@ -269,7 +269,11 @@ class Nix:
:param path: a string or Path to convert
:return: a Path object holding the rewritten, physical system path to the store entry
"""
return Path(str(path).replace("/nix/store", self.store_dir.as_posix()))
return (
Path(str(path).replace("/nix/store", self.store_dir.as_posix()))
if str(path).startswith("/nix/store")
else Path(path)
)
def hash_path(self, store_path: str | Path, *args: str) -> str:
"""