summaryrefslogtreecommitdiff
path: root/test/buildtool/file_system/git_tree.test.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'test/buildtool/file_system/git_tree.test.cpp')
-rw-r--r--test/buildtool/file_system/git_tree.test.cpp7
1 files changed, 4 insertions, 3 deletions
diff --git a/test/buildtool/file_system/git_tree.test.cpp b/test/buildtool/file_system/git_tree.test.cpp
index 7c5b53e3..1526e9c9 100644
--- a/test/buildtool/file_system/git_tree.test.cpp
+++ b/test/buildtool/file_system/git_tree.test.cpp
@@ -555,13 +555,14 @@ TEST_CASE("Thread-safety", "[git_tree]") {
SECTION("Parsing same tree with same CAS") {
auto cas = GitCAS::Open(*repo_path);
REQUIRE(cas);
- auto repo = GitRepo::Open(cas);
- REQUIRE(repo);
for (int id{}; id < kNumThreads; ++id) {
- threads.emplace_back([&repo, &starting_signal]() {
+ threads.emplace_back([&cas, &starting_signal]() {
starting_signal.wait(false);
+ auto repo = GitRepo::Open(cas);
+ REQUIRE(repo);
+
auto entries = repo->ReadTree(kTreeId, true);
REQUIRE(entries);
});