git: Update repository HEAD in create_branch().

This commit is contained in:
tastytea 2020-07-01 10:19:18 +02:00
parent ca61c1e391
commit df60f738f4
Signed by: tastytea
GPG Key ID: CFC39497F1B26E07

View File

@ -113,6 +113,7 @@ void create_branch()
{
const auto id{get_last_id() + 1};
const string branch_name = "web-" + std::to_string(id);
const string ref_name{"refs/heads/" + branch_name};
git_oid oid_parent;
git_commit *commit;
@ -125,6 +126,8 @@ void create_branch()
git_reference *branch;
// Create new branch.
check(git_branch_create(&branch, _repo, branch_name.c_str(), commit, 0));
check(git_repository_set_head(_repo, ref_name.c_str()));
}
void commit(const entry_type &entry)