summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
Diffstat (limited to 'lib')
-rw-r--r--lib/gitlab_projects.rb7
1 files changed, 6 insertions, 1 deletions
diff --git a/lib/gitlab_projects.rb b/lib/gitlab_projects.rb
index 49a1d25..9586345 100644
--- a/lib/gitlab_projects.rb
+++ b/lib/gitlab_projects.rb
@@ -116,8 +116,13 @@ class GitlabProjects
# timeout for push
timeout = (ARGV.shift || 120).to_i
+ # push with --force?
+ forced = ARGV.delete('--force') if ARGV.include?('--force')
+
$logger.info "Pushing branches from #{full_path} to remote #{remote_name}: #{ARGV}"
- cmd = %W(git --git-dir=#{full_path} push -- #{remote_name}).concat(ARGV)
+ cmd = %W(git --git-dir=#{full_path} push)
+ cmd << forced if forced
+ cmd += %W(-- #{remote_name}).concat(ARGV)
pid = Process.spawn(*cmd)
begin