diff options
author | Robert Speicher <robert@gitlab.com> | 2017-09-19 17:39:29 +0000 |
---|---|---|
committer | Robert Speicher <robert@gitlab.com> | 2017-09-19 17:39:29 +0000 |
commit | 5390855b077fc9b37f4d16a580be5caaffbe65e8 (patch) | |
tree | f4fb290fb4eb78f712fc8258edf800e6ab49a25d /lib | |
parent | 2b575a8d646aa0dc45db6b8a371c7f6648f2ad69 (diff) | |
parent | 2f94bc3ecae26612a392f35e821db2976856e2cd (diff) | |
download | gitlab-shell-5390855b077fc9b37f4d16a580be5caaffbe65e8.tar.gz |
Merge branch 'add-force-push-option-to-push-branches' into 'master'
Adds --force option to push branches.
See merge request gitlab-org/gitlab-shell!167
Diffstat (limited to 'lib')
-rw-r--r-- | lib/gitlab_projects.rb | 7 |
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 |