diff options
-rw-r--r-- | Makefile | 2 | ||||
-rw-r--r-- | cgit.c | 17 | ||||
m--------- | git | 0 |
3 files changed, 12 insertions, 7 deletions
@@ -14,7 +14,7 @@ htmldir = $(docdir) pdfdir = $(docdir) mandir = $(prefix)/share/man SHA1_HEADER = <openssl/sha.h> -GIT_VER = 2.21.0 +GIT_VER = 2.22.0 GIT_URL = https://www.kernel.org/pub/software/scm/git/git-$(GIT_VER).tar.xz INSTALL = install COPYTREE = cp -r @@ -19,6 +19,16 @@ const char *cgit_version = CGIT_VERSION; +__attribute__((constructor)) +static void constructor_environment() +{ + /* Do not look in /etc/ for gitconfig and gitattributes. */ + setenv("GIT_CONFIG_NOSYSTEM", "1", 1); + setenv("GIT_ATTR_NOSYSTEM", "1", 1); + unsetenv("HOME"); + unsetenv("XDG_CONFIG_HOME"); +} + static void add_mimetype(const char *name, const char *value) { struct string_list_item *item; @@ -565,18 +575,13 @@ static void prepare_repo_env(int *nongit) /* The path to the git repository. */ setenv("GIT_DIR", ctx.repo->path, 1); - /* Do not look in /etc/ for gitconfig and gitattributes. */ - setenv("GIT_CONFIG_NOSYSTEM", "1", 1); - setenv("GIT_ATTR_NOSYSTEM", "1", 1); - unsetenv("HOME"); - unsetenv("XDG_CONFIG_HOME"); - /* Setup the git directory and initialize the notes system. Both of these * load local configuration from the git repository, so we do them both while * the HOME variables are unset. */ setup_git_directory_gently(nongit); init_display_notes(NULL); } + static int prepare_repo_cmd(int nongit) { struct object_id oid; diff --git a/git b/git -Subproject 8104ec994ea3849a968b4667d072fedd1e68864 +Subproject b697d92f56511e804b8ba20ccbe7bdc85dc6681 |