summaryrefslogtreecommitdiff
path: root/spec
diff options
context:
space:
mode:
authorRoland Moriz <roland@moriz.de>2018-04-06 12:58:28 +0200
committerRoland Moriz <roland@moriz.de>2018-04-06 13:01:04 +0200
commit6d476386cf278105cf3c41414392ecb90c2bb00a (patch)
tree010a456bf988a498534aa515d662f066b35ce1ba /spec
parentdcabccc37c0017d7ca330f1c54e6fd385a51eaf8 (diff)
downloadchef-6d476386cf278105cf3c41414392ecb90c2bb00a.tar.gz
prune remotes with git fetch, fixes #3929
Signed-off-by: Roland Moriz <roland@moriz.de>
Diffstat (limited to 'spec')
-rw-r--r--spec/unit/provider/git_spec.rb16
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]")