libgit2/libgit2sharp — pull request #253 by jamill (2012-11-26 19:50:03+00:00)
Title: Clean untracked files from working directory

Current checkout tests rely on `Reset` to update the tracked and untracked files in a working directory. However, proper behavior is for `Reset` to only modify the tracked files. This PR:

1. Implements functionality to remove untracked files from the working directory
2. Updates the checkout tests to clean the working directory

Some other thoughts:

* I currently have the `CleanWorkingDirectory` implemented on the `Index` class, but I could see this exposed off of the `Repository` class as well, which is where some other methods that impact both the index and the working directory exist (e.g. `Reset`).

* There is not currently an explicit git clean function exposed in libgit2 - I implemented this functionality through calling `git_checkout_index` with a parameter indicating that it should remove untracked files. This means that not all the core `git clean` options are supported, such as removing ignored files as well. If there are other cases where cleaning with `git_checkout_index` does not behave as we want here, please bring them up as well.