forked from lix-project/lix
* A transaction is unnecessary since the path cannot be
garbage-collected (it's a temporary root).
This commit is contained in:
parent
d7caac3e81
commit
f789ea1d09
|
@ -628,11 +628,8 @@ void LocalStore::exportPath(const Path & path, bool sign,
|
||||||
{
|
{
|
||||||
assertStorePath(path);
|
assertStorePath(path);
|
||||||
|
|
||||||
/* Wrap all of this in a transaction to make sure that we export
|
|
||||||
consistent metadata. */
|
|
||||||
Transaction txn(nixDB);
|
|
||||||
addTempRoot(path);
|
addTempRoot(path);
|
||||||
if (!isValidPathTxn(txn, path))
|
if (!isValidPath(path))
|
||||||
throw Error(format("path `%1%' is not valid") % path);
|
throw Error(format("path `%1%' is not valid") % path);
|
||||||
|
|
||||||
HashAndWriteSink hashAndWriteSink(sink);
|
HashAndWriteSink hashAndWriteSink(sink);
|
||||||
|
@ -644,10 +641,10 @@ void LocalStore::exportPath(const Path & path, bool sign,
|
||||||
writeString(path, hashAndWriteSink);
|
writeString(path, hashAndWriteSink);
|
||||||
|
|
||||||
PathSet references;
|
PathSet references;
|
||||||
nix::queryReferences(txn, path, references);
|
queryReferences(path, references);
|
||||||
writeStringSet(references, hashAndWriteSink);
|
writeStringSet(references, hashAndWriteSink);
|
||||||
|
|
||||||
Path deriver = nix::queryDeriver(txn, path);
|
Path deriver = queryDeriver(path);
|
||||||
writeString(deriver, hashAndWriteSink);
|
writeString(deriver, hashAndWriteSink);
|
||||||
|
|
||||||
if (sign) {
|
if (sign) {
|
||||||
|
@ -677,8 +674,6 @@ void LocalStore::exportPath(const Path & path, bool sign,
|
||||||
|
|
||||||
} else
|
} else
|
||||||
writeInt(0, hashAndWriteSink);
|
writeInt(0, hashAndWriteSink);
|
||||||
|
|
||||||
txn.commit();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue