Nguyễn Thái Ngọc Duy [off-list ref] writes:
I did start pushing the_repository out of library code [1] in the bottom
half of this series. There aren't big surprises except that cache-tree
API now take _both_ struct repository and struct index_state. The
reason is cache-tree can work on temporary indexes and repo->index is
about $GIT_DIR/index.
Yes, this is very sensible, and I expect many more functions would
(and probably should) follow suit, as we'd want to be able to work
with temporary index (not in the sense that we'll write out on-disk
temporary index, but multiple in-core instances of istate that is
not necessarily tied to the current or the next state of
$GIT_DIR/index) from more places.