{
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
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