summaryrefslogtreecommitdiff
path: root/setup.c
diff options
context:
space:
mode:
Diffstat (limited to 'setup.c')
-rw-r--r--setup.c6
1 files changed, 5 insertions, 1 deletions
diff --git a/setup.c b/setup.c
index 5c7946d..0309c27 100644
--- a/setup.c
+++ b/setup.c
@@ -987,7 +987,7 @@ const char *setup_git_directory_gently(int *nongit_ok)
{
static struct strbuf cwd = STRBUF_INIT;
struct strbuf dir = STRBUF_INIT, gitdir = STRBUF_INIT;
- const char *prefix;
+ const char *prefix, *env_prefix;
/*
* We may have read an incomplete configuration before
@@ -1045,6 +1045,10 @@ const char *setup_git_directory_gently(int *nongit_ok)
die("BUG: unhandled setup_git_directory_1() result");
}
+ env_prefix = getenv(GIT_TOPLEVEL_PREFIX_ENVIRONMENT);
+ if (env_prefix)
+ prefix = env_prefix;
+
if (prefix)
setenv(GIT_PREFIX_ENVIRONMENT, prefix, 1);
else