Commits

Anonymous committed af41867 Merge

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

Comments (0)

Files changed (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;