git.c (656B)
1 #include "git.h" 2 3 #include <git2/common.h> 4 #include <git2/config.h> 5 #include <git2/global.h> 6 #include <git2/oid.h> 7 8 /* Global const data. */ 9 const size_t kOidLen = GIT_OID_SHA1_HEXSIZE + 1; 10 11 void gitout_git_initialize(void) { 12 /* do not search outside the git repository: 13 GIT_CONFIG_LEVEL_APP is the highest level currently */ 14 git_libgit2_init(); 15 for (int i = 1; i <= GIT_CONFIG_LEVEL_APP; i++) { 16 git_libgit2_opts(GIT_OPT_SET_SEARCH_PATH, i, ""); 17 } 18 /* do not require the git repository to be owned by the current user */ 19 git_libgit2_opts(GIT_OPT_SET_OWNER_VALIDATION, 0); 20 } 21 22 void gitout_git_shutdown(void) { 23 git_libgit2_shutdown(); 24 }