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

Re: [PATCH] worktree: drop unused code from get_main_worktree()

From
Junio C Hamano <gitster@pobox.com>
Date
Feb 24, 2020, 20:20 UTC
Message-ID
<xmqqh7zfpwjm.fsf@gitster-ct.c.googlers.com>
In-Reply-To
<20200224064049.GD1015967@coredump.intra.peff.net>
Jeff King <peff@peff.net> writes:
Show 7 quoted lines
> On Sun, Feb 23, 2020 at 08:59:35PM -0500, Eric Sunshine wrote:
>
>> This code has been unused since fa099d2322 (worktree.c: kill parse_ref()
>> in favor of refs_resolve_ref_unsafe(), 2017-04-24), so drop it.
>
> Looks obviously correct, unless we are depending on some side effect of
> get_git_common_dir(). And if we are, then that should be fixed. ;)

Heh, get_git_common_dir() could be implemented to have some "setup" kind of side effect for the first call to it, but what is removed is the second call ;-) Besides, the body of get_git_common_dir() is a mere three lines that does not have any side effect, so...

Previous: Jeff King
Message 3 of 3 in “worktree: drop unused code from get_main_worktree()”
  1. worktree: drop unused code from get_main_worktree()Eric Sunshine, Feb 24, 2020
  2. Jeff KingFeb 24, 2020
  3. Junio C HamanoFeb 24, 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.