Skip to content

Commit

Permalink
Merge branch 'ks/maint-getenv-fix' into maint
Browse files Browse the repository at this point in the history
* ks/maint-getenv-fix:
  setup: make sure git_dir path is in a permanent buffer, getenv(3) case
  • Loading branch information
Junio C Hamano committed Dec 11, 2010
2 parents 1a3e302 + 15431ca commit af41867
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions environment.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down

0 comments on commit af41867

Please sign in to comment.