diff --git a/lix/libstore/local-store.cc b/lix/libstore/local-store.cc index 265c74df6..9ea377dd0 100644 --- a/lix/libstore/local-store.cc +++ b/lix/libstore/local-store.cc @@ -1216,9 +1216,9 @@ try { bool narRead = false; Finally cleanup = [&]() { if (!narRead) { - NARParseVisitor sink; try { - parseDump(sink, source); + auto copy = copyNAR(source); + while (copy.next()) {} } catch (...) { ignoreExceptionExceptInterrupt(); } diff --git a/lix/libstore/store-api.cc b/lix/libstore/store-api.cc index 4be189b30..587827db3 100644 --- a/lix/libstore/store-api.cc +++ b/lix/libstore/store-api.cc @@ -461,14 +461,14 @@ try { information to narSink. */ TeeSource tapped { fileSource, narSink }; - NARParseVisitor blank; - auto & parseSink = method == FileIngestionMethod::Flat - ? fileSink - : blank; - - /* The information that flows from tapped (besides being replicated in - narSink), is now put in parseSink. */ - parseDump(parseSink, tapped); + // the information flows from tapped into narSink. we only check that the + // nar is correct, and during flat ingestion contains only a single file. + if (method == FileIngestionMethod::Flat) { + parseDump(fileSink, tapped); + } else { + auto copy = copyNAR(tapped); + while (copy.next()) {} + } /* We extract the result of the computation from the sink by calling finish. */