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

Re: [PATCH] worktree: avoid dead-code in conditional

From
Junio C Hamano <gitster@pobox.com>
Date
Jun 25, 2020, 00:38 UTC
Message-ID
<xmqqbll8569x.fsf@gitster.c.googlers.com>
In-Reply-To
<CAPig+cRdRyWAjU7QADPt39rDgJ4njDtN_pwo8JMVD=YX09a-Vg@mail.gmail.com>
Eric Sunshine <sunshine@sunshineco.com> writes:
Show 13 quoted lines
> Callers of get_git_common_dir() aren't forced to care. But after
> applying strbuf_add_absolute_path() we are forced to care. This is the
> result of get_git_common_dir() for the three cases:
>
>     .     (within bare repo)
>     .git  (within any worktree)
>     .     (within .git)
>
> After applying strbuf_add_absolute_path(), we get:
>
>     /whatever/proj.git/.   (within bare proj)
>     /whatever/proj/.git    (within any worktree)
>     /whatever/proj/.git/.  (within .git)
OK, but the point still stands.  
Shouldn't strbuf_add_absolute_path() be what we want to normalize?
> Your puzzlement may arise from the misunderstanding regarding
> get_git_common_dir() vs. strbuf_add_absolute_path()?
Yes, exactly.
Thanks.
Previous: Eric Sunshine
Message 4 of 4 in “worktree: avoid dead-code in conditional”
  1. worktree: avoid dead-code in conditionalEric Sunshine, Jun 24, 2020
  2. Junio C HamanoJun 24, 2020
  3. Eric SunshineJun 24, 2020
  4. Junio C HamanoJun 25, 2020

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.