summaryrefslogtreecommitdiff
path: root/app/models/project.rb
diff options
context:
space:
mode:
authorDmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com>2013-12-16 21:30:24 +0200
committerDmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com>2013-12-16 21:30:24 +0200
commit80c4657fa78eaf7d360e0f247243736387b5ce87 (patch)
treeb816855fad37f39bfcd98337aa41c038f3b82af6 /app/models/project.rb
parentf40ad6ce403e4365e4b5515cfa593437babb1298 (diff)
parent28bb65f3637ae16c98f374248e3ffa5f26983443 (diff)
downloadgitlab-ce-80c4657fa78eaf7d360e0f247243736387b5ce87.tar.gz
Merge branch 'improve/repo_head_update'
Signed-off-by: Dmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com> Conflicts: app/models/project.rb
Diffstat (limited to 'app/models/project.rb')
-rw-r--r--app/models/project.rb5
1 files changed, 5 insertions, 0 deletions
diff --git a/app/models/project.rb b/app/models/project.rb
index d389579b3a1..1bfc27d723d 100644
--- a/app/models/project.rb
+++ b/app/models/project.rb
@@ -482,4 +482,9 @@ class Project < ActiveRecord::Base
def unarchive!
update_attribute(:archived, false)
end
+
+ def change_head(branch)
+ gitlab_shell.update_repository_head(self.path_with_namespace, branch)
+ reload_default_branch
+ end
end