summaryrefslogtreecommitdiff
path: root/src/buildtool/file_system/git_utils.cpp
diff options
context:
space:
mode:
authorPaul Cristian Sarbu <paul.cristian.sarbu@huawei.com>2023-03-27 18:15:08 +0200
committerPaul Cristian Sarbu <paul.cristian.sarbu@huawei.com>2023-03-30 13:45:00 +0200
commited9bfe29a1d54a6dca1fa85853457c56108a6183 (patch)
treedcfa02e41e34cb727855e2d8cdbf0bcb9bbb2fba /src/buildtool/file_system/git_utils.cpp
parent0c90ad4bf580a385aa7056298452980b5f8ceb83 (diff)
downloadjustbuild-ed9bfe29a1d54a6dca1fa85853457c56108a6183.tar.gz
GitRepo: Guard fake repository odb wrapping
In the current libgit2 implementation, a fake repository wrapped around an existing odb is being registered as owner the same way as a normal repository object. Therefore, one has to guard both the creation and destruction of the fake repository against all other git operations that might access the internal cache during this transfer of ownership.
Diffstat (limited to 'src/buildtool/file_system/git_utils.cpp')
-rw-r--r--src/buildtool/file_system/git_utils.cpp6
1 files changed, 0 insertions, 6 deletions
diff --git a/src/buildtool/file_system/git_utils.cpp b/src/buildtool/file_system/git_utils.cpp
index a38fae39..a3b503ab 100644
--- a/src/buildtool/file_system/git_utils.cpp
+++ b/src/buildtool/file_system/git_utils.cpp
@@ -69,12 +69,6 @@ auto GitObjectID(std::string const& id, bool is_hex_id) noexcept
#endif // BOOTSTRAP_BUILD_TOOL
}
-void repo_closer(gsl::owner<git_repository*> repo) {
-#ifndef BOOTSTRAP_BUILD_TOOL
- git_repository_free(repo);
-#endif
-}
-
void odb_closer(gsl::owner<git_odb*> odb) {
#ifndef BOOTSTRAP_BUILD_TOOL
git_odb_free(odb);