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

Re: [PATCH] remote: pass NULL to read_ref_full() because object ID is not needed

From
Derrick Stolee <stolee@gmail.com>
Date
Dec 11, 2019, 18:57 UTC
Message-ID
<a1bfb55c-21dd-12e6-186b-44c1873d1c52@gmail.com>
In-Reply-To
<24fc1649-d80c-cc4b-8268-a7833812d39c@web.de>
On 12/11/2019 1:46 PM, René Scharfe wrote:
> read_ref_full() wraps refs_read_ref_full(), which in turn wraps
> refs_resolve_ref_unsafe(), which handles a NULL oid pointer of callers
> not interested in the resolved object ID.  Make use of that feature to
> document that mv() is such a caller.
Double-checking the code shows this in refs_resolve_ref_unsafe():
        if (!oid)
                oid = &unused_oid;

where unused_oid is a local struct. Unfortunate that the correct code change doesn't get any performance benefit for sending this message of "I don't need this value".

LGTM.
-Stolee
Previous: René Scharfe
Message 2 of 2 in “remote: pass NULL to read_ref_full() because object ID is not needed”
  1. remote: pass NULL to read_ref_full() because object ID is not neededRené Scharfe, Dec 11, 2019
  2. Derrick StoleeDec 11, 2019

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.