Skip to content

Commit 1867132

Browse files
edolstraxokdvium
andcommitted
Apply suggestions from code review
Co-authored-by: Sergei Zimmerman <sergei@zimmerman.foo>
1 parent f444b27 commit 1867132

File tree

2 files changed

+5
-1
lines changed

2 files changed

+5
-1
lines changed

src/libfetchers/git-utils.cc

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1198,6 +1198,8 @@ struct GitFileSystemObjectSinkImpl : GitFileSystemObjectSink
11981198

11991199
void createRegularFile(const CanonPath & path, std::function<void(CreateRegularFileSink &)> func) override
12001200
{
1201+
checkInterrupt();
1202+
12011203
/* Multithreaded blob writing. We read the incoming file data into memory and asynchronously write it to a Git
12021204
blob object. However, to avoid unbounded memory usage, if the amount of data in flight exceeds a threshold,
12031205
we switch to writing directly to a Git write stream. */
@@ -1361,6 +1363,8 @@ struct GitFileSystemObjectSinkImpl : GitFileSystemObjectSink
13611363
auto repo(repoPool.get());
13621364

13631365
[&](this const auto & visit, Directory & node) -> void {
1366+
checkInterrupt();
1367+
13641368
// Write the child directories.
13651369
for (auto & child : node.children)
13661370
if (auto dir = std::get_if<Directory>(&child.second.file))

src/libutil/include/nix/util/pool.hh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -215,7 +215,7 @@ public:
215215
std::vector<ref<R>> clear()
216216
{
217217
auto state_(state.lock());
218-
return std::move(state_->idle);
218+
return std::exchange(state_->idle, {});
219219
}
220220
};
221221

0 commit comments

Comments
 (0)