git: Update repository HEAD in create_branch().
This commit is contained in:
parent
ca61c1e391
commit
df60f738f4
|
@ -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)
|
||||
|
|
Reference in New Issue
Block a user