remain compatible with slightly older libgit versions for now
authorHiltjo Posthuma <hiltjo@codemadness.org>
Tue, 24 May 2022 12:07:27 +0000 (14:07 +0200)
committerHiltjo Posthuma <hiltjo@codemadness.org>
Tue, 24 May 2022 12:07:27 +0000 (14:07 +0200)
stagit-index.c
stagit.c

index 735775b1ccbe8eef2434db2efa4ef90e8ae253f4..d2f22a5e5ec5c18b6a621db6a717e5fb7b74b852 100644 (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)
index 2a9c3fe7bcb19dade7bf44f7496e67d0ec154308..911643e9e86a34a9abda835995be222cdfcbdf51 100644 (file)
--- 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)