diff options
Diffstat (limited to 'src/libstore/references.cc')
-rw-r--r-- | src/libstore/references.cc | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/src/libstore/references.cc b/src/libstore/references.cc index 9b20b980a..5ceae6427 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; } |