Commit 6d7ccca3 authored by Gabriel Mazetto's avatar Gabriel Mazetto

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 secondary node
replication.
parent ff31080b
...@@ -135,8 +135,13 @@ class GitlabProjects ...@@ -135,8 +135,13 @@ class GitlabProjects
# timeout for fetch # timeout for fetch
timeout = (ARGV.shift || 120).to_i timeout = (ARGV.shift || 120).to_i
# fetch with --force ?
forced = (ARGV.shift == '--force' || false)
$logger.info "Fetching remote #{@name} for project #{@project_name}." $logger.info "Fetching remote #{@name} for project #{@project_name}."
cmd = %W(git --git-dir=#{full_path} fetch #{@name} --tags) cmd = %W(git --git-dir=#{full_path} fetch #{@name} --tags)
cmd << '--force' if forced
pid = Process.spawn(*cmd) pid = Process.spawn(*cmd)
begin begin
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment