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 /spec/gitlab_projects_spec.rb | |
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 'spec/gitlab_projects_spec.rb')
-rw-r--r-- | spec/gitlab_projects_spec.rb | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/spec/gitlab_projects_spec.rb b/spec/gitlab_projects_spec.rb index 2220ee4..ffba3d4 100644 --- a/spec/gitlab_projects_spec.rb +++ b/spec/gitlab_projects_spec.rb @@ -313,6 +313,18 @@ describe GitlabProjects do expect(gl_projects.exec).to be false end + + context 'with --force' do + let(:cmd) { %W(git --git-dir=#{full_path} push --force -- #{remote_name} #{branch_name}) } + let(:gl_projects) { build_gitlab_projects('push-branches', repos_path, project_name, remote_name, '600', '--force', 'master') } + + it 'executes the command' do + expect(Process).to receive(:spawn).with(*cmd).and_return(pid) + expect(Process).to receive(:wait).with(pid) + + expect(gl_projects.exec).to be true + end + end end describe :fetch_remote do |