diff options
Diffstat (limited to 'source/cgit.c')
| -rw-r--r-- | source/cgit.c | 8 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
1 file changed, 5 insertions, 3 deletions
diff --git a/source/cgit.c b/source/cgit.c index 6d663fe..5f8ecfa 100644 --- a/source/cgit.c +++ b/source/cgit.c @@ -56,10 +56,12 @@ struct refmatch { /* * Isolate git from the calling user's configuration, which could otherwise - * break once HOME is unset below. Called from cmd_main rather than from a - * constructor attribute, because git-compat-util.h defines __attribute__ - * away on a compiler without it, which would leave this silently unrun. + * break once HOME is unset below. It runs as a constructor because git reads + * the global config for its trace settings before cmd_main is reached, and + * cmd_main calls it again for a compiler that drops the attribute, which + * git-compat-util.h defines away where it is unsupported. */ +__attribute__((constructor)) static void isolate_git_environment(void) { setenv("GIT_CONFIG_NOSYSTEM", "1", 1); |
