Update src/nix/prefetch.cc

Co-authored-by: Eelco Dolstra <edolstra@gmail.com>
This commit is contained in:
Jörg Thalheim 2024-07-05 19:45:03 +02:00 committed by GitHub
parent 8cea1fbd97
commit 05381c0b30
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -118,7 +118,7 @@ std::tuple<StorePath, Hash> prefetchFile(
/* If the archive unpacks to a single file/directory, then use
that as the top-level. */
tmpFile = entries->path();
unsigned fileCount = std::distance(entries, std::filesystem::directory_iterator{});
auto fileCount = std::distance(entries, std::filesystem::directory_iterator{});
if (fileCount != 1) {
/* otherwise, use the directory itself */
tmpFile = unpacked;