[#446] small refactoring
This commit is contained in:
parent
4026b75784
commit
1c6f8c5127
|
@ -63,9 +63,9 @@ module Project::DefaultBranch
|
||||||
|
|
||||||
# Private: Set git head.
|
# Private: Set git head.
|
||||||
def set_new_git_head
|
def set_new_git_head
|
||||||
if self.default_branch_changed? && self.repo.branches.map(&:name).include?(self.default_branch)
|
if default_branch_changed? && repo.branches.map(&:name).include?(default_branch)
|
||||||
self.repo.git.send(:'symbolic-ref', {}, 'HEAD', "refs/heads/#{self.default_branch}")
|
repo.git.send(:'symbolic-ref', {}, 'HEAD', "refs/heads/#{default_branch}")
|
||||||
Project.project_aliases(self).update_all default_branch: self.default_branch
|
Project.project_aliases(self).update_all default_branch: default_branch
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue