1
0
Fork 0
mirror of https://github.com/git/git.git synced 2024-06-08 00:46:11 +02:00

Merge branch 'ks/maint-getenv-fix'

* ks/maint-getenv-fix:
  setup: make sure git_dir path is in a permanent buffer, getenv(3) case
This commit is contained in:
Junio C Hamano 2010-12-08 11:24:13 -08:00
commit 09a8fbd59c

View File

@ -88,6 +88,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;