From: Derrick Stolee Date: Mon, 16 Nov 2026 13:11:33 GMT Subject: Re: [PATCH] read-cache: use istate->repo in overlay_tree_on_index() Message-ID: In-Reply-To: On 11/16/2026 5:34 AM, Srujith A Poojary via GitGitGadget wrote: > From: Srujith A Poojary > > 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