From: Derrick Stolee <stolee@gmail.com>
To: git@vger.kernel.org
Subject: Re: [PATCH] read-cache: use istate->repo in overlay_tree_on_index()
Date: Mon, 16 Nov 2026 08:11:33 -0500 [thread overview]
Message-ID: <b7abaeba-1dd9-45f3-ad63-e43c49ee48d4@gmail.com> (raw)
In-Reply-To: <pull.2315.git.1794825269464.gitgitgadget@gmail.com>
On 11/16/2026 5:34 AM, Srujith A Poojary via GitGitGadget wrote:
> 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
next prev parent reply other threads:[~2026-11-16 13:11 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-11-16 10:34 [PATCH] read-cache: use istate->repo in overlay_tree_on_index() Srujith A Poojary via GitGitGadget
2026-11-16 13:11 ` Derrick Stolee [this message]
2026-11-16 16:51 ` Junio C Hamano
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=b7abaeba-1dd9-45f3-ad63-e43c49ee48d4@gmail.com \
--to=stolee@gmail.com \
--cc=git@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.