diff options
author | Dmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com> | 2013-12-16 19:34:56 +0200 |
---|---|---|
committer | Dmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com> | 2013-12-16 19:34:56 +0200 |
commit | 28bb65f3637ae16c98f374248e3ffa5f26983443 (patch) | |
tree | 6a97b3d18acc9a564a9de4173eb0349f73bf226d /app/models/project.rb | |
parent | 99490159e5f9d6ff4b45f78b977d01caa1e3c4fc (diff) | |
download | gitlab-ce-28bb65f3637ae16c98f374248e3ffa5f26983443.tar.gz |
Update repository head successively during project update
It prevents situation when async worker slowly updates HEAD and we show
old branch as repository HEAD in project settings
Signed-off-by: Dmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com>
Diffstat (limited to 'app/models/project.rb')
-rw-r--r-- | app/models/project.rb | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/app/models/project.rb b/app/models/project.rb index 506f34ca6b6..5f0303dfb06 100644 --- a/app/models/project.rb +++ b/app/models/project.rb @@ -472,4 +472,9 @@ class Project < ActiveRecord::Base def visibility_level_field visibility_level end + + def change_head(branch) + gitlab_shell.update_repository_head(self.path_with_namespace, branch) + reload_default_branch + end end |