diff options
| author | mo khan <mo.khan@gmail.com> | 2020-11-19 15:43:39 -0700 |
|---|---|---|
| committer | mo khan <mo.khan@gmail.com> | 2020-11-19 15:43:39 -0700 |
| commit | ea05833387dbe655f933cc8de1391e43bce5bd81 (patch) | |
| tree | a671ad7500d20dcb8a48cb4b18d553279827f919 | |
| parent | da848f7ecd69af21a5bb7b6c519d6ead76102753 (diff) | |
fix: exception true is not available in 2.5 and 2.6
| -rw-r--r-- | lib/spandx/core/git.rb | 8 | ||||
| -rw-r--r-- | spec/integration/core/git_spec.rb | 4 |
2 files changed, 6 insertions, 6 deletions
diff --git a/lib/spandx/core/git.rb b/lib/spandx/core/git.rb index 170a721..2a38594 100644 --- a/lib/spandx/core/git.rb +++ b/lib/spandx/core/git.rb @@ -33,14 +33,14 @@ module Spandx end def clone!(branch: default_branch) - system('rm', '-rf', root.to_s, exception: true) if root.exist? - system('git', 'clone', '--quiet', '--depth=1', '--single-branch', '--branch', branch, url, root.to_s, exception: true) + system('rm', '-rf', root.to_s) if root.exist? + system('git', 'clone', '--quiet', '--depth=1', '--single-branch', '--branch', branch, url, root.to_s) end def pull!(remote: 'origin', branch: default_branch) Dir.chdir(root) do - system('git', 'fetch', '--quiet', '--depth=1', '--prune', '--no-tags', remote, exception: true) - system('git', 'checkout', '--quiet', branch, exception: true) + system('git', 'fetch', '--quiet', '--depth=1', '--prune', '--no-tags', remote) + system('git', 'checkout', '--quiet', branch) end end end diff --git a/spec/integration/core/git_spec.rb b/spec/integration/core/git_spec.rb index f20020b..d431dbd 100644 --- a/spec/integration/core/git_spec.rb +++ b/spec/integration/core/git_spec.rb @@ -32,7 +32,7 @@ RSpec.describe Spandx::Core::Git do subject.update! end - specify { expect(shell).to have_received(:system).with('git', 'clone', '--quiet', '--depth=1', '--single-branch', '--branch', 'main', url, expected_path, exception: true) } + specify { expect(shell).to have_received(:system).with('git', 'clone', '--quiet', '--depth=1', '--single-branch', '--branch', 'main', url, expected_path) } end context 'when the repository has already been cloned' do @@ -45,7 +45,7 @@ RSpec.describe Spandx::Core::Git do subject.update! end - it { expect(shell).to have_received(:system).with('git', 'fetch', '--quiet', '--depth=1', '--prune', '--no-tags', 'origin', exception: true) } + it { expect(shell).to have_received(:system).with('git', 'fetch', '--quiet', '--depth=1', '--prune', '--no-tags', 'origin') } end end end |
