libgit2/libgit2 — pull request #1118 by arrbee (2012-12-04 01:05:58+00:00)
Title: Fix reset hard and checkout corner cases

This is actually a fairly significant reorganization of checkout internals.

1. Make it possible to checkout based on any pair of expected / desired iterators instead of tied to a pre-loaded index, and
2. Drive checkout off the diff of expected-to-desired instead of the diff between desired-to-workdir, and
3. Map correct behavior much more completely to get corner cases, and
4. Add more general notification callbacks for things such as dirty files in the working directory besides just conflicts.

With these changes a more complete emulation of core git checkout is possible, plus it will be possible to drive checkout to do what is needed for reset hard.

**This is still a WORK IN PROGRESS - I just wanted to push up the current state of things**