summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLibravatar Junio C Hamano <gitster@pobox.com>2010-12-10 16:12:51 -0800
committerLibravatar Junio C Hamano <gitster@pobox.com>2010-12-10 16:12:51 -0800
commitaf41867169c6350e2e73a1bfd8f3f2dd5a17bba6 (patch)
tree25c9780c08b03b5e495e6f0b862d694b8f561d11
parentAdd --force to git-send-email documentation (diff)
parentsetup: make sure git_dir path is in a permanent buffer, getenv(3) case (diff)
downloadtgif-af41867169c6350e2e73a1bfd8f3f2dd5a17bba6.tar.xz
Merge branch 'ks/maint-getenv-fix' into maint
* ks/maint-getenv-fix: setup: make sure git_dir path is in a permanent buffer, getenv(3) case
-rw-r--r--environment.c1
1 files changed, 1 insertions, 0 deletions
diff --git a/environment.c b/environment.c
index de5581fe51..18aded6dc4 100644
--- a/environment.c
+++ b/environment.c
@@ -87,6 +87,7 @@ const char * const local_repo_env[LOCAL_REPO_ENV_SIZE + 1] = {
static void setup_git_env(void)
{
git_dir = getenv(GIT_DIR_ENVIRONMENT);
+ git_dir = git_dir ? xstrdup(git_dir) : NULL;
if (!git_dir) {
git_dir = read_gitfile_gently(DEFAULT_GIT_DIR_ENVIRONMENT);
git_dir = git_dir ? xstrdup(git_dir) : NULL;