diff options
author | Douwe Maan <douwe@gitlab.com> | 2016-03-03 15:35:13 +0000 |
---|---|---|
committer | Douwe Maan <douwe@gitlab.com> | 2016-03-03 15:35:13 +0000 |
commit | 0261a26e19bd600ab11a0a45fd76de3cb928ac21 (patch) | |
tree | a6d40182e6245822fcf55c6506dd2ce12abb9ae1 | |
parent | ff31080b0d5b5e7c99bfe7738aaa2bb1fafe60fb (diff) | |
parent | b4537bf0766f07a8e1bc91cc93e59023ba9341ba (diff) | |
download | gitlab-shell-0261a26e19bd600ab11a0a45fd76de3cb928ac21.tar.gz |
Merge branch 'feature/fetch-remote-forced' into 'master'
Added an optional --force parameter for gitlab-projects fetch-remote
The optional parameter will decide wheter to fetch using --force or not.
fetching with --force is a requirement for Gitlab Geo (https://gitlab.com/gitlab-org/gitlab-ee/issues/76) secondary node
replication.
This is a dependency for https://gitlab.com/gitlab-org/gitlab-ee/merge_requests/179
See merge request !41
-rw-r--r-- | VERSION | 2 | ||||
-rw-r--r-- | lib/gitlab_projects.rb | 7 |
2 files changed, 7 insertions, 2 deletions
@@ -1 +1 @@ -2.6.10 +2.6.11 diff --git a/lib/gitlab_projects.rb b/lib/gitlab_projects.rb index c1d175a..82a16fc 100644 --- a/lib/gitlab_projects.rb +++ b/lib/gitlab_projects.rb @@ -60,7 +60,7 @@ class GitlabProjects when 'import-project'; import_project when 'fork-project'; fork_project when 'fetch-remote'; fetch_remote - when 'update-head'; update_head + when 'update-head'; update_head when 'gc'; gc else $logger.warn "Attempt to execute invalid gitlab-projects command #{@command.inspect}." @@ -135,8 +135,13 @@ class GitlabProjects # timeout for fetch timeout = (ARGV.shift || 120).to_i + + # fetch with --force ? + forced = (ARGV.shift == '--force') + $logger.info "Fetching remote #{@name} for project #{@project_name}." cmd = %W(git --git-dir=#{full_path} fetch #{@name} --tags) + cmd << '--force' if forced pid = Process.spawn(*cmd) begin |