From 1c6f8c512779283f951a7dd63f78d2cfd2df007e Mon Sep 17 00:00:00 2001 From: Alexander Machehin Date: Tue, 10 Mar 2015 20:54:42 +0500 Subject: [PATCH] [#446] small refactoring --- app/models/concerns/project/default_branch.rb | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/app/models/concerns/project/default_branch.rb b/app/models/concerns/project/default_branch.rb index dfd9213a2..bb0aaf902 100644 --- a/app/models/concerns/project/default_branch.rb +++ b/app/models/concerns/project/default_branch.rb @@ -63,9 +63,9 @@ module Project::DefaultBranch # Private: Set git head. def set_new_git_head - if self.default_branch_changed? && self.repo.branches.map(&:name).include?(self.default_branch) - self.repo.git.send(:'symbolic-ref', {}, 'HEAD', "refs/heads/#{self.default_branch}") - Project.project_aliases(self).update_all default_branch: self.default_branch + if default_branch_changed? && repo.branches.map(&:name).include?(default_branch) + repo.git.send(:'symbolic-ref', {}, 'HEAD', "refs/heads/#{default_branch}") + Project.project_aliases(self).update_all default_branch: default_branch end end