aboutsummaryrefslogtreecommitdiffstats
path: root/cgit.c
diff options
context:
space:
mode:
authorChristian Hesse2019-05-13 21:41:37 +0200
committerChristian Hesse2019-10-25 11:40:17 +0200
commit034e3c7d56ba71ce281886fe8525b16d4559fac1 (patch)
treeb49d5d3c52f90f9f67d4e842cbc5c1cfa348cc9b /cgit.c
parente1ad15d368bdeb1bffea588b93a29055c5dfb7f4 (diff)
downloadcgit-034e3c7d56ba71ce281886fe8525b16d4559fac1.tar.gz
cgit-034e3c7d56ba71ce281886fe8525b16d4559fac1.tar.bz2
cgit-034e3c7d56ba71ce281886fe8525b16d4559fac1.zip
git: update to v2.22.0
Update to git version v2.22.0. Upstream commit bce9db6d ("trace2: use system/global config for default trace2 settings") caused a regression. We have to unset HOME and XDG_CONFIG_HOME before early loading of config from trace2 code kicks in. Signed-off-by: Christian Hesse <mail@eworm.de>
Diffstat (limited to 'cgit.c')
-rw-r--r--cgit.c17
1 files changed, 11 insertions, 6 deletions
diff --git a/cgit.c b/cgit.c
index 2910d4b..ac8c641 100644
--- a/cgit.c
+++ b/cgit.c
@@ -19,6 +19,16 @@
19 19
20const char *cgit_version = CGIT_VERSION; 20const char *cgit_version = CGIT_VERSION;
21 21
22__attribute__((constructor))
23static void constructor_environment()
24{
25 /* Do not look in /etc/ for gitconfig and gitattributes. */
26 setenv("GIT_CONFIG_NOSYSTEM", "1", 1);
27 setenv("GIT_ATTR_NOSYSTEM", "1", 1);
28 unsetenv("HOME");
29 unsetenv("XDG_CONFIG_HOME");
30}
31
22static void add_mimetype(const char *name, const char *value) 32static void add_mimetype(const char *name, const char *value)
23{ 33{
24 struct string_list_item *item; 34 struct string_list_item *item;
@@ -565,18 +575,13 @@ static void prepare_repo_env(int *nongit)
565 /* The path to the git repository. */ 575 /* The path to the git repository. */
566 setenv("GIT_DIR", ctx.repo->path, 1); 576 setenv("GIT_DIR", ctx.repo->path, 1);
567 577
568 /* Do not look in /etc/ for gitconfig and gitattributes. */
569 setenv("GIT_CONFIG_NOSYSTEM", "1", 1);
570 setenv("GIT_ATTR_NOSYSTEM", "1", 1);
571 unsetenv("HOME");
572 unsetenv("XDG_CONFIG_HOME");
573
574 /* Setup the git directory and initialize the notes system. Both of these 578 /* Setup the git directory and initialize the notes system. Both of these
575 * load local configuration from the git repository, so we do them both while 579 * load local configuration from the git repository, so we do them both while
576 * the HOME variables are unset. */ 580 * the HOME variables are unset. */
577 setup_git_directory_gently(nongit); 581 setup_git_directory_gently(nongit);
578 init_display_notes(NULL); 582 init_display_notes(NULL);
579} 583}
584
580static int prepare_repo_cmd(int nongit) 585static int prepare_repo_cmd(int nongit)
581{ 586{
582 struct object_id oid; 587 struct object_id oid;