forked from lix-project/lix
LocalStore::addTextToStore(): Don't read the path we just wrote
This eliminates some unnecessary (presumably cached) I/O.
This commit is contained in:
parent
9ccbd55c5b
commit
5a64e66268
|
@ -1444,14 +1444,16 @@ Path LocalStore::addTextToStore(const string & name, const string & s,
|
||||||
|
|
||||||
canonicalisePathMetaData(dstPath, -1);
|
canonicalisePathMetaData(dstPath, -1);
|
||||||
|
|
||||||
HashResult hash = hashPath(htSHA256, dstPath);
|
StringSink sink;
|
||||||
|
dumpString(s, sink);
|
||||||
|
auto hash = hashString(htSHA256, sink.s);
|
||||||
|
|
||||||
optimisePath(dstPath);
|
optimisePath(dstPath);
|
||||||
|
|
||||||
ValidPathInfo info;
|
ValidPathInfo info;
|
||||||
info.path = dstPath;
|
info.path = dstPath;
|
||||||
info.narHash = hash.first;
|
info.narHash = hash;
|
||||||
info.narSize = hash.second;
|
info.narSize = sink.s.size();
|
||||||
info.references = references;
|
info.references = references;
|
||||||
registerValidPath(info);
|
registerValidPath(info);
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue