Code

obstack: Fix portability issues
[git.git] / setup.c
diff --git a/setup.c b/setup.c
index 699fcf096d98f9875586cf07297eb87b431f5961..2c51a9a4c7665ce786e58e312c55f9f8b4bca6ae 100644 (file)
--- a/setup.c
+++ b/setup.c
@@ -742,6 +742,11 @@ const char *setup_git_directory_gently(int *nongit_ok)
        const char *prefix;
 
        prefix = setup_git_directory_gently_1(nongit_ok);
+       if (prefix)
+               setenv("GIT_PREFIX", prefix, 1);
+       else
+               setenv("GIT_PREFIX", "", 1);
+
        if (startup_info) {
                startup_info->have_repository = !nongit_ok || !*nongit_ok;
                startup_info->prefix = prefix;