about summary refs log tree commit diff
path: root/src/libstore/references.cc
diff options
context:
space:
mode:
Diffstat (limited to 'src/libstore/references.cc')
-rw-r--r--src/libstore/references.cc8
1 files changed, 6 insertions, 2 deletions
diff --git a/src/libstore/references.cc b/src/libstore/references.cc
index 9b20b980a1b2..5ceae6427617 100644
--- a/src/libstore/references.cc
+++ b/src/libstore/references.cc
@@ -81,8 +81,12 @@ Strings filterReferences(const string & path, const Strings & paths)
     for (Strings::const_iterator i = paths.begin();
          i != paths.end(); i++)
     {
-        string s = string(baseNameOf(*i), 0, 32);
-        parseHash(s);
+        string baseName = baseNameOf(*i);
+        unsigned int pos = baseName.find('-');
+        if (pos == string::npos)
+            throw Error(format("bad reference `%1%'") % *i);
+        string s = string(baseName, 0, pos);
+        // parseHash(htSHA256, s);
         ids.push_back(s);
         backMap[s] = *i;
     }