diff options
author | Tim Smith <tsmith@chef.io> | 2018-04-27 10:46:27 -0700 |
---|---|---|
committer | GitHub <noreply@github.com> | 2018-04-27 10:46:27 -0700 |
commit | c87e6e21b802ba3bc2798adf2bf867b91ed5dd00 (patch) | |
tree | 92d44ac26a5a3bcbbf9f17c285f43d0320f36ab7 /spec/unit | |
parent | d64f00f476c9bbcab8cc8cb3e15c6bd1df2a8761 (diff) | |
parent | 6d476386cf278105cf3c41414392ecb90c2bb00a (diff) | |
download | chef-c87e6e21b802ba3bc2798adf2bf867b91ed5dd00.tar.gz |
Merge pull request #7129 from rmoriz/rmoriz/git-prune
prune remotes with git fetch, fixes #3929
Diffstat (limited to 'spec/unit')
-rw-r--r-- | spec/unit/provider/git_spec.rb | 16 |
1 files changed, 8 insertions, 8 deletions
diff --git a/spec/unit/provider/git_spec.rb b/spec/unit/provider/git_spec.rb index cacee0baaa..c32c2ee146 100644 --- a/spec/unit/provider/git_spec.rb +++ b/spec/unit/provider/git_spec.rb @@ -425,9 +425,9 @@ SHAS it "runs a sync command with default options" do expect(@provider).to receive(:setup_remote_tracking_branches).with(@resource.remote, @resource.repository) - expected_cmd1 = "git fetch origin" + expected_cmd1 = "git fetch --prune origin" expect(@provider).to receive(:shell_out!).with(expected_cmd1, :cwd => "/my/deploy/dir", :log_tag => "git[web2.0 app]") - expected_cmd2 = "git fetch origin --tags" + expected_cmd2 = "git fetch --prune-tags origin --tags" expect(@provider).to receive(:shell_out!).with(expected_cmd2, :cwd => "/my/deploy/dir", :log_tag => "git[web2.0 app]") expected_cmd3 = "git reset --hard d35af14d41ae22b19da05d7d03a0bafc321b244c" expect(@provider).to receive(:shell_out!).with(expected_cmd3, :cwd => "/my/deploy/dir", :log_tag => "git[web2.0 app]") @@ -440,12 +440,12 @@ SHAS @resource.group("thisis") expect(@provider).to receive(:setup_remote_tracking_branches).with(@resource.remote, @resource.repository) - expected_cmd1 = "git fetch origin" + expected_cmd1 = "git fetch --prune origin" expect(@provider).to receive(:shell_out!).with(expected_cmd1, :cwd => "/my/deploy/dir", :user => "whois", :group => "thisis", :log_tag => "git[web2.0 app]", :environment => { "HOME" => "/home/whois" }) - expected_cmd2 = "git fetch origin --tags" + expected_cmd2 = "git fetch --prune-tags origin --tags" expect(@provider).to receive(:shell_out!).with(expected_cmd2, :cwd => "/my/deploy/dir", :user => "whois", :group => "thisis", :log_tag => "git[web2.0 app]", @@ -461,9 +461,9 @@ SHAS it "configures remote tracking branches when remote is ``origin''" do @resource.remote "origin" expect(@provider).to receive(:setup_remote_tracking_branches).with(@resource.remote, @resource.repository) - fetch_command1 = "git fetch origin" + fetch_command1 = "git fetch --prune origin" expect(@provider).to receive(:shell_out!).with(fetch_command1, :cwd => "/my/deploy/dir", :log_tag => "git[web2.0 app]") - fetch_command2 = "git fetch origin --tags" + fetch_command2 = "git fetch --prune-tags origin --tags" expect(@provider).to receive(:shell_out!).with(fetch_command2, :cwd => "/my/deploy/dir", :log_tag => "git[web2.0 app]") fetch_command3 = "git reset --hard d35af14d41ae22b19da05d7d03a0bafc321b244c" expect(@provider).to receive(:shell_out!).with(fetch_command3, :cwd => "/my/deploy/dir", :log_tag => "git[web2.0 app]") @@ -473,9 +473,9 @@ SHAS it "configures remote tracking branches when remote is not ``origin''" do @resource.remote "opscode" expect(@provider).to receive(:setup_remote_tracking_branches).with(@resource.remote, @resource.repository) - fetch_command1 = "git fetch opscode" + fetch_command1 = "git fetch --prune opscode" expect(@provider).to receive(:shell_out!).with(fetch_command1, :cwd => "/my/deploy/dir", :log_tag => "git[web2.0 app]") - fetch_command2 = "git fetch opscode --tags" + fetch_command2 = "git fetch --prune-tags opscode --tags" expect(@provider).to receive(:shell_out!).with(fetch_command2, :cwd => "/my/deploy/dir", :log_tag => "git[web2.0 app]") fetch_command3 = "git reset --hard d35af14d41ae22b19da05d7d03a0bafc321b244c" expect(@provider).to receive(:shell_out!).with(fetch_command3, :cwd => "/my/deploy/dir", :log_tag => "git[web2.0 app]") |