libgit2/libgit2sharp — pull request #233 by jamill (2012-10-22 18:32:45+00:00)
Title: Update working directory on Checkout

This is an initial implementation of updating the working directory as part of Checkout (using `git_checkout_head`)

I am labeling this as a work in progress because I do not include any progress reporting (until the progress callbacks are in libgit2 and make it to LibGit2Sharp).

As there is not support for merge in libgit2, I only allow checking out the working directory if there are no changes in the current branch (staged, unstages, or untracked) by default. I do support taking a `Force` option, but it behaves slightly differently from `git checkout -f` on the command line (see below).

### CheckoutOptions
I expose a bit flag enum `CheckoutOptions` on the `Checkout()` API. Currently, this only exposes a single flag (`Force`) - but once more checkout behavior is supported in libgit2 we can add extra flags here (`Merge`, `AutoMerge`, etc). One thing I am not sure of is how closely this particular API should match options exposed on the Git command line vs the flexibility exposed by libgit2.

As it is, `CheckoutOptions.Force` does not completly mimic `git checkout -f branch`, as `git_checkout_head` currently resets the whole working directory, while `git checkout -f` leaves untracked files. There is a small discussion on libgit2 checkout options at libgit2/libgit2#986

Any feedback is appreciated. I will close Issue #227, and continue the discussion on this thread.