@@ -77,6 +77,7 @@ pub unsafe fn get_search_path(level: ConfigLevel) -> Result<CString, Error> {
77
77
/// Disabling this will cause repository objects to clear their caches when next
78
78
/// accessed.
79
79
pub fn enable_caching ( enabled : bool ) {
80
+ crate :: init ( ) ;
80
81
let error = unsafe {
81
82
raw:: git_libgit2_opts (
82
83
raw:: GIT_OPT_ENABLE_CACHING as libc:: c_int ,
@@ -94,6 +95,7 @@ pub fn enable_caching(enabled: bool) {
94
95
/// creation of objects that reference invalid objects (due to programming
95
96
/// error or repository corruption).
96
97
pub fn strict_object_creation ( enabled : bool ) {
98
+ crate :: init ( ) ;
97
99
let error = unsafe {
98
100
raw:: git_libgit2_opts (
99
101
raw:: GIT_OPT_ENABLE_STRICT_OBJECT_CREATION as libc:: c_int ,
@@ -110,6 +112,7 @@ pub fn strict_object_creation(enabled: bool) {
110
112
/// improve performance, at the cost of relying on repository integrity
111
113
/// without checking it.
112
114
pub fn strict_hash_verification ( enabled : bool ) {
115
+ crate :: init ( ) ;
113
116
let error = unsafe {
114
117
raw:: git_libgit2_opts (
115
118
raw:: GIT_OPT_ENABLE_STRICT_HASH_VERIFICATION as libc:: c_int ,
@@ -181,6 +184,7 @@ where
181
184
/// Set wheter or not to verify ownership before performing a repository.
182
185
/// Enabled by default, but disabling this can lead to code execution vulnerabilities.
183
186
pub unsafe fn set_verify_owner_validation ( enabled : bool ) -> Result < ( ) , Error > {
187
+ crate :: init ( ) ;
184
188
let error = raw:: git_libgit2_opts (
185
189
raw:: GIT_OPT_SET_OWNER_VALIDATION as libc:: c_int ,
186
190
enabled as libc:: c_int ,
0 commit comments