1
0
Fork 0
mirror of https://github.com/NixOS/nix synced 2025-07-10 04:43:53 +02:00

Fix test failures

This commit is contained in:
Eelco Dolstra 2016-04-21 18:21:25 +02:00
parent 7d14f5c331
commit 21ef1670b3
3 changed files with 6 additions and 5 deletions

View file

@ -691,7 +691,7 @@ void LocalStore::collectGarbage(const GCOptions & options, GCResults & results)
string name = dirent->d_name;
if (name == "." || name == "..") continue;
Path path = settings.nixStore + "/" + name;
if (isValidPath(path))
if (isStorePath(path) && isValidPath(path))
entries.push_back(path);
else
tryToDelete(state, path);

View file

@ -17,6 +17,7 @@ bool isInStore(const Path & path)
bool isStorePath(const Path & path)
{
return isInStore(path)
&& path.size() >= settings.nixStore.size() + 1 + storePathHashLen
&& path.find('/', settings.nixStore.size() + 1) == Path::npos;
}