git2-rs icon indicating copy to clipboard operation
git2-rs copied to clipboard

Fix normal merge in examples/pull.rs

Open luveti opened this issue 1 year ago • 0 comments

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.

luveti avatar Oct 14 '24 01:10 luveti