lib/rubocop/git/runner.rb in rubocop-git-0.0.6 vs lib/rubocop/git/runner.rb in rubocop-git-0.1.0
- old
+ new
@@ -33,15 +33,12 @@
end
def git_diff(options)
args = %w(diff --diff-filter=AMCR --find-renames --find-copies)
- if options.cached
- args << '--cached'
- elsif options.commit_last
- args << options.commit_first.shellescape
- args << options.commit_last.shellescape
- end
+ args << '--cached' if options.cached
+ args << options.commit_first.shellescape if options.commit_first
+ args << options.commit_last.shellescape if options.commit_last
`git #{args.join(' ')}`
end
def display_violations(io)