From: Jayesh Daga Date: Tue, 31 Mar 2026 15:34:27 +0000 (+0000) Subject: unpack-trees: use repository from index instead of global X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=c74767b7a33325dcbf58df6977bc9442b0c35375;p=thirdparty%2Fgit.git unpack-trees: use repository from index instead of global unpack_trees() currently initializes its repository from the global 'the_repository', even though a repository instance is already available via the source index. Use 'o->src_index->repo' instead of the global variable, reducing reliance on global repository state. This is a step towards eliminating global repository usage in unpack_trees(). Suggested-by: Patrick Steinhardt Signed-off-by: Jayesh Daga Signed-off-by: Junio C Hamano --- diff --git a/unpack-trees.c b/unpack-trees.c index 191b9d4769..b42020f16b 100644 --- a/unpack-trees.c +++ b/unpack-trees.c @@ -1882,7 +1882,7 @@ static int verify_absent(const struct cache_entry *, */ int unpack_trees(unsigned len, struct tree_desc *t, struct unpack_trees_options *o) { - struct repository *repo = the_repository; + struct repository *repo = o->src_index->repo; int i, ret; static struct cache_entry *dfc; struct pattern_list pl;