libgit2/libgit2 — pull request #1133 by arrbee (2012-12-10 23:49:57+00:00)
Title: More iterator cleanup

In the course of working on fixing `git_checkout`, I've ended up fixing a few things about iterators and I thought I'd pull them out into a separate PR to keep the checkout work clean.

This PR does 4 main things with iterators:

1. Remove unnecessary parameters to constructors (e.g. if you are passing in a tree, you don't also need to pass in the `git_repository` that contains the tree).
2. Fix broken `git_iterator_reset()` command for iterators where a range was set. This was detected when I added tests to try a reset and repeat of the existing tests.
3. Extend `git_iterator_reset()` with the ability to update the start/end range of the iterator.
4. For workdir iterators, add optimization so that directory entries outside of the iterator range will not be stat'ed. Previously, if you iterated from 'c' to 'd' in a directory that contained all 'a' .. 'z' entries, we would stat all entries then just use the ones in the range we care about. This reduces the stats just to the relevant range (which turned out to be complicated by the need to be case insensitive).

These changes should allow me to simplify the checkout fixes PR (and the API changes should clean up some of the code there, too).