git/list[1] front-page[2] threads[3] people[4] search[5] about
 

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?

Previous: Junio C Hamano
Message 7 of 7 in “grep: simple test for operation in a bare repository”
  1. grep: simple test for operation in a bare repositoryRené Scharfe, Feb 3, 2010
  2. René ScharfeFeb 3, 2010
  3. René ScharfeFeb 5, 2010
  4. Nguyen Thai Ngoc DuyFeb 5, 2010
  5. René ScharfeFeb 6, 2010
  6. Junio C HamanoFeb 6, 2010
  7. Junio C HamanoFeb 5, 2010

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.