Re: [PATCH] grep: simple test for operation in a bare repository
- From
Junio C Hamano <gitster@pobox.com>
- Date
- Feb 5, 2010, 06:50 UTC
- Message-ID
- <7vd40kjhvm.fsf@alter.siamese.dyndns.org>
- In-Reply-To
- <4B6B653A.8060909@lsrfire.ath.cx>
René Scharfe <rene.scharfe@lsrfire.ath.cx> writes:
Show 18 quoted lines
> There are five more sites in git.c, path.c and setup.c where $GIT_DIR
> is set directly with setenv(). I wonder if they should better call
> set_git_dir() instead, too.
>
>
> diff --git a/setup.c b/setup.c
> index 710e2f3..5fb9b25 100644
> --- a/setup.c
> +++ b/setup.c
> @@ -406,7 +406,7 @@ const char *setup_git_directory_gently(int *nongit_ok)
> cwd[offset] = '\0';
> setenv(GIT_DIR_ENVIRONMENT, cwd, 1);
> } else
> - setenv(GIT_DIR_ENVIRONMENT, ".", 1);
> + set_git_dir(".");
> check_repository_format_gently(nongit_ok);
> return NULL;
> }Yeah, shouldn't the other setenv() we see in the context need a similar change as well?