about summary refs log tree commit diff
diff options
context:
space:
mode:
-rw-r--r--src/libstore/build.cc6
1 files changed, 3 insertions, 3 deletions
diff --git a/src/libstore/build.cc b/src/libstore/build.cc
index 62a03f751add..e8a70296fdb0 100644
--- a/src/libstore/build.cc
+++ b/src/libstore/build.cc
@@ -2810,11 +2810,11 @@ void SubstitutionGoal::finished()
         return;
     }
 
-    canonicalisePathMetaData(destPath, -1);
+    if (repair) replaceValidPath(storePath, destPath);
 
-    worker.store.optimisePath(destPath); // FIXME: combine with hashPath()
+    canonicalisePathMetaData(storePath, -1);
 
-    if (repair) replaceValidPath(storePath, destPath);
+    worker.store.optimisePath(storePath); // FIXME: combine with hashPath()
 
     ValidPathInfo info2;
     info2.path = storePath;