summaryrefslogtreecommitdiff
path: root/src/buildtool/file_system/git_utils.cpp
diff options
context:
space:
mode:
authorMaksim Denisov <denisov.maksim@huawei.com>2024-10-02 12:27:42 +0200
committerMaksim Denisov <denisov.maksim@huawei.com>2024-10-07 13:37:39 +0200
commitf56805ddde51ffcfdd6123300b6c049764a86980 (patch)
tree0b18734f5a60bddec7bb44c32b4027529de056e8 /src/buildtool/file_system/git_utils.cpp
parente2555394980ab4d1d8b938fec0ad8d246d7745b4 (diff)
downloadjustbuild-f56805ddde51ffcfdd6123300b6c049764a86980.tar.gz
Replace manual new allocations for git_strarray with std::vectors
...and remove unused code from git_utils
Diffstat (limited to 'src/buildtool/file_system/git_utils.cpp')
-rw-r--r--src/buildtool/file_system/git_utils.cpp32
1 files changed, 0 insertions, 32 deletions
diff --git a/src/buildtool/file_system/git_utils.cpp b/src/buildtool/file_system/git_utils.cpp
index d9833521..8612d039 100644
--- a/src/buildtool/file_system/git_utils.cpp
+++ b/src/buildtool/file_system/git_utils.cpp
@@ -82,38 +82,6 @@ void tree_closer(gsl::owner<git_tree*> tree) {
#endif
}
-void treebuilder_closer(gsl::owner<git_treebuilder*> builder) {
-#ifndef BOOTSTRAP_BUILD_TOOL
- git_treebuilder_free(builder);
-#endif
-}
-
-void index_closer(gsl::owner<git_index*> index) {
-#ifndef BOOTSTRAP_BUILD_TOOL
- git_index_free(index);
-#endif
-}
-
-void strarray_closer(gsl::owner<git_strarray*> strarray) {
-#ifndef BOOTSTRAP_BUILD_TOOL
- git_strarray_dispose(strarray);
-#endif
-}
-
-void strarray_deleter(gsl::owner<git_strarray*> strarray) {
-#ifndef BOOTSTRAP_BUILD_TOOL
- if (strarray->strings != nullptr) {
- for (std::size_t i = 0; i < strarray->count; ++i) {
- // NOLINTNEXTLINE(cppcoreguidelines-owning-memory,cppcoreguidelines-pro-bounds-pointer-arithmetic)
- delete[] strarray->strings[i];
- }
- delete[] strarray->strings;
- strarray->strings = nullptr;
- strarray->count = 0;
- }
-#endif
-}
-
void signature_closer(gsl::owner<git_signature*> signature) {
#ifndef BOOTSTRAP_BUILD_TOOL
git_signature_free(signature);