git2-rs
git2-rs copied to clipboard
Fix normal merge in examples/pull.rs
Repository::commit needs to be called, otherwise the index gets goofed up.
In my specific case, it resulted in a file created in a fetched commit being staged for deletion.
https://libgit2.org/libgit2/ex/HEAD/merge.html was referenced for this fix.
I also added a call to Repository::cleanup_state that was used in the libgit2 example. They did not call Repository::checkout_head so I've removed that.