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

Re: use of PWD

From
Junio C Hamano <gitster@pobox.com>
Date
Nov 11, 2017, 02:13 UTC
Message-ID
<xmqqd14pef5q.fsf@gitster.mtv.corp.google.com>
In-Reply-To
<20171108075336.is4awgyw53dohf7y@sigill.intra.peff.net>
Jeff King <peff@peff.net> writes:
Show 25 quoted lines
> So totally orthogonal to your bug, I wonder if we ought to be doing:
>
> diff --git a/sha1_file.c b/sha1_file.c
> index 057262d46e..0b76233aa7 100644
> --- a/sha1_file.c
> +++ b/sha1_file.c
> @@ -530,11 +530,11 @@ void prepare_alt_odb(void)
>  	if (alt_odb_tail)
>  		return;
>  
> -	alt = getenv(ALTERNATE_DB_ENVIRONMENT);
> -	if (!alt) alt = "";
> -
>  	alt_odb_tail = &alt_odb_list;
> -	link_alt_odb_entries(alt, strlen(alt), PATH_SEP, NULL, 0);
> +
> +	alt = getenv(ALTERNATE_DB_ENVIRONMENT);
> +	if (alt)
> +		link_alt_odb_entries(alt, strlen(alt), PATH_SEP, NULL, 0);
>  
>  	read_info_alternates(get_object_directory(), 0);
>  }
>
> to avoid hitting link_alt_odb_entries() at all when there are no
> entries.
Sounds sane.
Previous: Jeff KingNext: Jeff King
Message 3 of 6 in “use of PWD”
  1. Joey HessNov 7, 2017
  2. Jeff KingNov 8, 2017
  3. Junio C HamanoNov 11, 2017
  4. link_alt_odb_entries: make empty input a noopJeff King, Nov 12, 2017
  5. Joey HessNov 13, 2017
  6. Junio C HamanoNov 14, 2017

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.