Fix update_cached_repo(), set HEAD to origin/main.
continuous-integration/drone/push Build is failing
Details
continuous-integration/drone/push Build is failing
Details
This commit is contained in:
parent
9707694be6
commit
43a29bfdba
|
@ -250,11 +250,13 @@ void update_cached_repo(const uint8_t timeout)
|
|||
fetch_opts.callbacks.credentials = cred_acquire;
|
||||
check(git_remote_fetch(remote, nullptr, &fetch_opts, nullptr));
|
||||
|
||||
// FIXME: HEAD is detached.
|
||||
git_checkout_options checkout_opts;
|
||||
check(git_checkout_options_init(&checkout_opts,
|
||||
GIT_CHECKOUT_OPTIONS_VERSION));
|
||||
checkout_opts.checkout_strategy = GIT_CHECKOUT_FORCE;
|
||||
check(git_repository_set_head(_repo, "refs/heads/main"));
|
||||
|
||||
check(git_repository_set_head(_repo, "refs/remotes/origin/main"));
|
||||
check(git_checkout_head(_repo, &checkout_opts));
|
||||
|
||||
git_remote_free(remote);
|
||||
|
|
Reference in New Issue