Jeff King <peff@xxxxxxxx> writes: > I get why you're doing it: your topic here only cares about removing > index dependencies, so you did the minimal thing to move that forward. > > But if you think about what this function is doing, it is quite clearly > dependent on the whole repository, since the userdiff config we're > looking up may come from repo config. In the case of userdiff that is pretty much limited to read-only operation, I fully agree, but in more general cases, we would need to pass both the repository and an in-core index separately, I would say. Imagine doing a partial commit, where we construct a separate istate that is not the "repo's index" and use that to write out a tree object to be wrapped in a new commit, and update the current branch ref.