diff options
| author | Dmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com> | 2013-06-25 17:05:39 +0300 |
|---|---|---|
| committer | Dmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com> | 2013-06-25 17:05:39 +0300 |
| commit | 58427749fd553ce802f037a7bdbbfd30f9df232a (patch) | |
| tree | 9ea36747dc7966ac68b8b36003ee1137e70c3312 /lib | |
| parent | 0705a7a5070dfa74db1f51e71aa74376bc000f11 (diff) | |
| download | gitlab-ce-58427749fd553ce802f037a7bdbbfd30f9df232a.tar.gz | |
Update repository head when change default project branch
Diffstat (limited to 'lib')
| -rw-r--r-- | lib/gitlab/backend/shell.rb | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/lib/gitlab/backend/shell.rb b/lib/gitlab/backend/shell.rb index 991648f3f79..8bced609e08 100644 --- a/lib/gitlab/backend/shell.rb +++ b/lib/gitlab/backend/shell.rb @@ -36,6 +36,18 @@ module Gitlab system "#{gitlab_shell_user_home}/gitlab-shell/bin/gitlab-projects", "mv-project", "#{path}.git", "#{new_path}.git" end + # Update HEAD for repository + # + # path - project path with namespace + # branch - repository branch name + # + # Ex. + # update_repository_head("gitlab/gitlab-ci", "3-1-stable") + # + def update_repository_head(path, branch) + system "#{gitlab_shell_user_home}/gitlab-shell/bin/gitlab-projects", "update-head", "#{path}.git", branch + end + # Fork repository to new namespace # # path - project path with namespace |
