commit 665e9a6ebfaec4ce18eeccca46b7aefa471d9791
parent 82b8f21627a1402e0de12b589008588b38a65804
Author: Oscar Benedito <oscar@oscarbenedito.com>
Date:   Wed, 31 Aug 2022 23:50:20 +0200

Merge tag '1.2'

Diffstat:
MMakefile | 6+++++-
Mstagit-index.c | 2++
Mstagit.c | 2++
3 files changed, 9 insertions(+), 1 deletion(-)

diff --git a/Makefile b/Makefile @@ -1,7 +1,7 @@ .POSIX: NAME = stagit -VERSION = 1.1 +VERSION = 1.2 # paths PREFIX = /usr/local @@ -16,6 +16,10 @@ STAGIT_CFLAGS = ${LIB_INC} ${CFLAGS} STAGIT_LDFLAGS = ${LIB_LIB} ${LDFLAGS} STAGIT_CPPFLAGS = -D_XOPEN_SOURCE=700 -D_DEFAULT_SOURCE -D_BSD_SOURCE +# Uncomment to enable workaround for older libgit2 which don't support this +# option. This workaround will be removed in the future *pinky promise*. +#STAGIT_CFLAGS += -DGIT_OPT_SET_OWNER_VALIDATION=-1 + SRC = \ stagit.c\ stagit-index.c diff --git a/stagit-index.c b/stagit-index.c @@ -190,6 +190,8 @@ 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, ""); + /* do not require the git repository to be owned by the current user */ + git_libgit2_opts(GIT_OPT_SET_OWNER_VALIDATION, 0); #ifdef __OpenBSD__ if (pledge("stdio rpath", NULL) == -1) diff --git a/stagit.c b/stagit.c @@ -1336,6 +1336,8 @@ 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, ""); + /* do not require the git repository to be owned by the current user */ + git_libgit2_opts(GIT_OPT_SET_OWNER_VALIDATION, 0); #ifdef __OpenBSD__ if (unveil(repodir, "r") == -1)