about summary refs log tree commit diff
path: root/src/libstore/local-store.cc
diff options
context:
space:
mode:
authorEelco Dolstra <e.dolstra@tudelft.nl>2008-12-03T16·10+0000
committerEelco Dolstra <e.dolstra@tudelft.nl>2008-12-03T16·10+0000
commitff762fb499be220ccd680f3bf68dca44a902a5ff (patch)
tree02f738ec60517e3eadd5b0a2bc2fe5c19c3d954c /src/libstore/local-store.cc
parent1307b222239da8e503d22ad9316789e30b4e2431 (diff)
* Pass HashType values instead of strings.
Diffstat (limited to 'src/libstore/local-store.cc')
-rw-r--r--src/libstore/local-store.cc6
1 files changed, 3 insertions, 3 deletions
diff --git a/src/libstore/local-store.cc b/src/libstore/local-store.cc
index fc62a99930a2..bb53caacc5b7 100644
--- a/src/libstore/local-store.cc
+++ b/src/libstore/local-store.cc
@@ -656,7 +656,7 @@ void LocalStore::invalidatePath(const Path & path)
 
 
 Path LocalStore::addToStore(const Path & _srcPath,
-    bool recursive, string hashAlgo, PathFilter & filter)
+    bool recursive, HashType hashAlgo, PathFilter & filter)
 {
     Path srcPath(absPath(_srcPath));
     debug(format("adding `%1%' to the store") % srcPath);
@@ -670,7 +670,7 @@ Path LocalStore::addToStore(const Path & _srcPath,
     else
         sink.s = readFile(srcPath);
 
-    Hash h = hashString(parseHashType(hashAlgo), sink.s);
+    Hash h = hashString(hashAlgo, sink.s);
 
     Path dstPath = makeFixedOutputPath(recursive, hashAlgo, h, baseNameOf(srcPath));
 
@@ -700,7 +700,7 @@ Path LocalStore::addToStore(const Path & _srcPath,
                above (if called with recursive == true and hashAlgo ==
                sha256); otherwise, compute it here. */
             registerValidPath(dstPath,
-                (recursive && hashAlgo == "sha256") ? h :
+                (recursive && hashAlgo == htSHA256) ? h :
                 (recursive ? hashString(htSHA256, sink.s) : hashPath(htSHA256, dstPath)),
                 PathSet(), "");
         }