1
1
Fork 0
mirror of https://github.com/NixOS/nix.git synced 2025-12-03 23:51:00 +01:00

MountedInputAccessor, FilteringInputAccessor: Respect the path display prefix/suffix

This was causing Git paths not to be rendered correctly.
This commit is contained in:
Eelco Dolstra 2024-04-16 15:38:44 +02:00
parent 6df58a0891
commit 79363b2273
3 changed files with 7 additions and 3 deletions

View file

@ -9,6 +9,8 @@ struct MountedInputAccessor : InputAccessor
MountedInputAccessor(std::map<CanonPath, ref<InputAccessor>> _mounts)
: mounts(std::move(_mounts))
{
displayPrefix.clear();
// Currently we require a root filesystem. This could be relaxed.
assert(mounts.contains(CanonPath::root));
@ -48,7 +50,7 @@ struct MountedInputAccessor : InputAccessor
std::string showPath(const CanonPath & path) override
{
auto [accessor, subpath] = resolve(path);
return accessor->showPath(subpath);
return displayPrefix + accessor->showPath(subpath) + displaySuffix;
}
std::pair<ref<InputAccessor>, CanonPath> resolve(CanonPath path)