Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

checkout_head is missing disclaimer #1148

Open
lolbinarycat opened this issue Mar 24, 2025 · 1 comment · May be fixed by #1149
Open

checkout_head is missing disclaimer #1148

lolbinarycat opened this issue Mar 24, 2025 · 1 comment · May be fixed by #1149

Comments

@lolbinarycat
Copy link

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.

vcfxb added a commit to vcfxb/git2-rs that referenced this issue Mar 25, 2025
@vcfxb
Copy link
Contributor

vcfxb commented Mar 25, 2025

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants