diff --git a/src/libstore/store-api.cc b/src/libstore/store-api.cc index 9c755965e..9ab3f3632 100644 --- a/src/libstore/store-api.cc +++ b/src/libstore/store-api.cc @@ -822,6 +822,7 @@ void copyPaths(ref from, ref to, const Paths & storePaths, bool su PathSet(storePaths.begin(), storePaths.end()), [&](const Path & storePath) { + if (to->isValidPath(storePath)) return PathSet(); return from->queryPathInfo(storePath)->references; },