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

Re: [PATCH] read-cache: use istate->repo in overlay_tree_on_index()

From
Derrick Stolee <stolee@gmail.com>
Date
Nov 16, 2026, 13:11 UTC
Message-ID
<b7abaeba-1dd9-45f3-ad63-e43c49ee48d4@gmail.com>
In-Reply-To
<pull.2315.git.1794825269464.gitgitgadget@gmail.com>
On 11/16/2026 5:34 AM, Srujith A Poojary via GitGitGadget wrote:
Show 8 quoted lines
> From: Srujith A Poojary <poojarysrujith@gmail.com>
> 
> Use the repository associated with the index state when
> resolving the tree name, parsing the tree, and reading
> its entries.
> 
> This avoids relying on the global repository when the
> function already has access to its associated repository.
Cleanups are good.
> +	struct repository *repo = istate->repo;
> -	if (repo_get_oid(the_repository, tree_name, &oid))
> +	if (repo_get_oid(repo, tree_name, &oid))
> -	tree = repo_parse_tree_indirect(the_repository, &oid);
> +	tree = repo_parse_tree_indirect(repo, &oid);
> -	err = read_tree(the_repository, tree, &pathspec, fn, istate);
> +	err = read_tree(repo, tree, &pathspec, fn, istate);

The only other way to do this would be to replace the_repository with 'istate->repo' directly, but having a 'repo' variable is just as good.

LGTM. -Stolee

Previous: Srujith A Poojary via GitGitGadgetNext: Junio C Hamano
Message 2 of 4 in “read-cache: use istate->repo in overlay_tree_on_index()”
  1. read-cache: use istate->repo in overlay_tree_on_index()Srujith A Poojary via GitGitGadget, Nov 16, 2026
  2. Derrick StoleeNov 16, 2026
  3. Junio C HamanoNov 16, 2026
  4. read-cache: use istate->repo in index operationsSrujith A Poojary via GitGitGadget, Nov 18, 2026

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.