about summary refs log tree commit diff
path: root/src/libstore/store-api.cc
diff options
context:
space:
mode:
Diffstat (limited to 'src/libstore/store-api.cc')
-rw-r--r--src/libstore/store-api.cc14
1 files changed, 2 insertions, 12 deletions
diff --git a/src/libstore/store-api.cc b/src/libstore/store-api.cc
index a560b3f55b8f..fb86fc6abbb7 100644
--- a/src/libstore/store-api.cc
+++ b/src/libstore/store-api.cc
@@ -96,25 +96,15 @@ Path makeFixedOutputPath(bool recursive,
 std::pair<Path, Hash> computeStorePathForPath(const Path & srcPath,
     bool fixed, bool recursive, string hashAlgo)
 {
-    Hash h(htSHA256);
-    {
-        SwitchToOriginalUser sw;
-        h = hashPath(htSHA256, srcPath);
-    }
+    Hash h = hashPath(htSHA256, srcPath);
 
     string baseName = baseNameOf(srcPath);
 
     Path dstPath;
     
     if (fixed) {
-
         HashType ht(parseHashType(hashAlgo));
-        Hash h2(ht);
-        {
-            SwitchToOriginalUser sw;
-            h2 = recursive ? hashPath(ht, srcPath) : hashFile(ht, srcPath);
-        }
-        
+        Hash h2 = recursive ? hashPath(ht, srcPath) : hashFile(ht, srcPath);
         dstPath = makeFixedOutputPath(recursive, hashAlgo, h2, baseName);
     }