summaryrefslogtreecommitdiff
path: root/app/contexts
diff options
context:
space:
mode:
authorDmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com>2013-11-27 10:49:59 +0200
committerDmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com>2013-11-27 10:49:59 +0200
commite2e11670222cfc5654dbefe05b688ae62add0b9c (patch)
tree26634ddf28d22bf45c8d76ccacb7526ed2cf05a7 /app/contexts
parent44c55307a0dc1d011cb9deabb2f1d631ebd2cb63 (diff)
downloadgitlab-ce-e2e11670222cfc5654dbefe05b688ae62add0b9c.tar.gz
Fix default branch being cached and show old one after change
Signed-off-by: Dmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com>
Diffstat (limited to 'app/contexts')
-rw-r--r--app/contexts/projects/update_context.rb4
1 files changed, 3 insertions, 1 deletions
diff --git a/app/contexts/projects/update_context.rb b/app/contexts/projects/update_context.rb
index 9564dd94688..8a7fcd144f8 100644
--- a/app/contexts/projects/update_context.rb
+++ b/app/contexts/projects/update_context.rb
@@ -5,12 +5,14 @@ module Projects
params[:project].delete(:public) unless can?(current_user, :change_public_mode, project)
new_branch = params[:project].delete(:default_branch)
- if project.repository.exists? && new_branch != project.repository.root_ref
+ if project.repository.exists? && new_branch != project.default_branch
GitlabShellWorker.perform_async(
:update_repository_head,
project.path_with_namespace,
new_branch
)
+
+ project.reload_default_branch
end
project.update_attributes(params[:project], as: role)