diff options
author | Christian Mollekopf <chrigi_1@fastmail.fm> | 2017-03-18 15:14:27 +0100 |
---|---|---|
committer | Christian Mollekopf <chrigi_1@fastmail.fm> | 2017-03-18 15:14:27 +0100 |
commit | 1b000ea460d6a37a0719f86e4d965ddf3ece0598 (patch) | |
tree | df8f682cce64c881745b71a222ee567184acadd5 | |
parent | 5c01a197f0fd90f611ed376e2165547a72771eb4 (diff) | |
download | sink-1b000ea460d6a37a0719f86e4d965ddf3ece0598.tar.gz sink-1b000ea460d6a37a0719f86e4d965ddf3ece0598.zip |
Call necessary libgit init and shutdown functions.
The library asserts otherwise
-rw-r--r-- | tests/hawd/state.cpp | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/tests/hawd/state.cpp b/tests/hawd/state.cpp index dbfe019..dfeef41 100644 --- a/tests/hawd/state.cpp +++ b/tests/hawd/state.cpp | |||
@@ -116,6 +116,7 @@ const char *State::commitHash() const | |||
116 | void State::findGitHash() | 116 | void State::findGitHash() |
117 | { | 117 | { |
118 | #ifdef HAVE_LIBGIT2 | 118 | #ifdef HAVE_LIBGIT2 |
119 | git_libgit2_init(); | ||
119 | git_buf root = {0}; | 120 | git_buf root = {0}; |
120 | int error = git_repository_discover(&root, projectPath().toStdString().data(), 0, NULL); | 121 | int error = git_repository_discover(&root, projectPath().toStdString().data(), 0, NULL); |
121 | if (!error) { | 122 | if (!error) { |
@@ -133,6 +134,7 @@ void State::findGitHash() | |||
133 | git_repository_free(repo); | 134 | git_repository_free(repo); |
134 | } | 135 | } |
135 | git_buf_free(&root); | 136 | git_buf_free(&root); |
137 | git_libgit2_shutdown(); | ||
136 | #endif | 138 | #endif |
137 | } | 139 | } |
138 | 140 | ||