summaryrefslogtreecommitdiff
path: root/test/main.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'test/main.cpp')
-rw-r--r--test/main.cpp10
1 files changed, 10 insertions, 0 deletions
diff --git a/test/main.cpp b/test/main.cpp
index c93583f2..bb431de2 100644
--- a/test/main.cpp
+++ b/test/main.cpp
@@ -13,9 +13,19 @@
// limitations under the License.
#include "catch2/catch_session.hpp"
+#include "src/buildtool/file_system/git_context.hpp"
#include "test/utils/logging/log_config.hpp"
auto main(int argc, char* argv[]) -> int {
ConfigureLogging();
+
+ /**
+ * The current implementation of libgit2 uses pthread_key_t incorrectly
+ * on POSIX systems to handle thread-specific data, which requires us to
+ * explicitly make sure the main thread is the first one to call
+ * git_libgit2_init. Future versions of libgit2 will hopefully fix this.
+ */
+ GitContext::Create();
+
return Catch::Session().run(argc, argv);
}