summaryrefslogtreecommitdiff
path: root/app/models
diff options
context:
space:
mode:
Diffstat (limited to 'app/models')
-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