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.
Passing #f for opts will use default checkout options.
procedure
( git_checkout_indexrepoindexopts)→integer?
repo:repository?index:index?
Passing #f for opts will use default checkout options.
procedure
( git_checkout_init_optionsoptsint)→integer?
opts:git_checkout_opts?int:unsigned
Passing #f for opts will use default checkout options.