rust-lang/git2-rs

checkout_head is missing disclaimer

Closed this issue · 1 comments

git_checkout_head has the following disclaimer:

Note that this is not the correct mechanism used to switch branches; do not change your HEAD and then call this method, that would leave you with checkout conflicts since your working directory would then appear to be dirty. Instead, checkout the target of the branch and then update HEAD using git_repository_set_head to point to the branch you checked out.

This should be translated to make sense with the rust api and included.

In my usecase git_checkout_head was doing literally nothing and it was very confusing.

@lolbinarycat feel free to review & make comments on #1149