diff options
author | Robert Speicher <robert@gitlab.com> | 2016-04-15 16:44:21 +0000 |
---|---|---|
committer | Robert Speicher <robert@gitlab.com> | 2016-04-15 16:44:21 +0000 |
commit | 34b056156049584939b65feafa26b4557ed7272c (patch) | |
tree | c65474ce2e247f061d68a9fbc95328516b6ef8c7 /app/models | |
parent | bb59a1f98eb44cbe288d876eb963e9467b8637f4 (diff) | |
parent | f8e8a61c9ce6d90347960a3fda8abd15c32ddc29 (diff) | |
download | gitlab-ce-34b056156049584939b65feafa26b4557ed7272c.tar.gz |
Merge branch 'pmq20/gitlab-ce-psvr/change-head' into 'master'
Use rugged to change HEAD
_Originally opened at !2850 by @pmq20._
Needless to invoke gitlab_shell here, which is slow.
See merge request !3705
Diffstat (limited to 'app/models')
-rw-r--r-- | app/models/project.rb | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/app/models/project.rb b/app/models/project.rb index fadc8bb2c9e..c4b0e484347 100644 --- a/app/models/project.rb +++ b/app/models/project.rb @@ -865,7 +865,9 @@ class Project < ActiveRecord::Base def change_head(branch) repository.before_change_head - gitlab_shell.update_repository_head(self.path_with_namespace, branch) + repository.rugged.references.create('HEAD', + "refs/heads/#{branch}", + force: true) reload_default_branch end |