remain compatible with slightly older libgit versions for now

This commit is contained in:
Hiltjo Posthuma 2022-05-24 14:07:27 +02:00
parent 1357ad5181
commit 70541c5e2c
2 changed files with 4 additions and 0 deletions

View file

@ -188,8 +188,10 @@ main(int argc, char *argv[])
git_libgit2_init();
for (i = 1; i <= GIT_CONFIG_LEVEL_APP; i++)
git_libgit2_opts(GIT_OPT_SET_SEARCH_PATH, i, "");
#ifdef GIT_OPT_SET_OWNER_VALIDATION
/* do not require the git repository to be owned by the current user */
git_libgit2_opts(GIT_OPT_SET_OWNER_VALIDATION, 0);
#endif
#ifdef __OpenBSD__
if (pledge("stdio rpath", NULL) == -1)

View file

@ -1235,8 +1235,10 @@ main(int argc, char *argv[])
git_libgit2_init();
for (i = 1; i <= GIT_CONFIG_LEVEL_APP; i++)
git_libgit2_opts(GIT_OPT_SET_SEARCH_PATH, i, "");
#ifdef GIT_OPT_SET_OWNER_VALIDATION
/* do not require the git repository to be owned by the current user */
git_libgit2_opts(GIT_OPT_SET_OWNER_VALIDATION, 0);
#endif
#ifdef __OpenBSD__
if (unveil(repodir, "r") == -1)