aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorHiltjo Posthuma <[email protected]>2022-05-24 14:07:27 +0200
committerHiltjo Posthuma <[email protected]>2022-05-24 14:07:27 +0200
commit70541c5e2cbdc141ba94e76899aba5f07047cecf (patch)
tree9433a308bcb66180ffda29764cc90f5a4ace981e
parent1357ad5181f80a99fe9c436af134e947ec7f4d29 (diff)
downloadstagit-70541c5e2cbdc141ba94e76899aba5f07047cecf.tar.gz
stagit-70541c5e2cbdc141ba94e76899aba5f07047cecf.zip
remain compatible with slightly older libgit versions for now
-rw-r--r--stagit-index.c2
-rw-r--r--stagit.c2
2 files changed, 4 insertions, 0 deletions
diff --git a/stagit-index.c b/stagit-index.c
index 735775b..d2f22a5 100644
--- a/stagit-index.c
+++ b/stagit-index.c
@@ -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)
diff --git a/stagit.c b/stagit.c
index 2a9c3fe..911643e 100644
--- a/stagit.c
+++ b/stagit.c
@@ -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)