Junio Hamano's patch 1/2 removes USE_THE_REPOSITORY from unpack-trees.c. The file implements low-level merge and checkout behaviour, and much of it could only work with the_repository. Both struct unpack_trees_options and struct index_state carry a pointer to the repository, and Hamano uses those pointers.

He writes that in correctly written clients the repository pointed at by the two structs must be the same one. The new unpack_repo() helper takes the structures and BUGs out if they disagree. Patch 2/2 renames variables so the index is consistently called 'struct index_state *istate'. Hamano says the series is almost the same as a version he posted earlier, minus two blank lines.

Patrick Steinhardt called it a curious interface with some ambiguity. He still thought it acceptable as an intermediate step and liked that it verifies the repository is the same, which he described as surprisingly complex but sensible and defensive. He noted a two-empty-lines nit. He also asked what should happen when a caller has both structures but does not pass them down, which could in theory hide a mismatch if entry points don't verify it. He called that ultimately not much of a problem.

Hamano explained the strict check. He is reasonably sure all the pointers must refer to the same repository but may have missed a legitimate case, and a simple first-non-null fallback would not show which assumption was violated.

Derrick Stolee agreed that making the code consistent will help later changes. He called the helper good, noting an extra empty line.