Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion lib/overcommit/hook/pre_commit/bundle_audit.rb
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,8 @@ class BundleAudit < Base

def run
# Ignore if Gemfile.lock is not tracked by git
ignored_files = execute(%w[git ls-files -o -i --exclude-standard]).stdout.split("\n")
ignored_files = execute(%W[git ls-files -o -i --exclude-standard -- #{LOCK_FILE}]).
stdout.split("\n")
return :pass if ignored_files.include?(LOCK_FILE)

result = execute(command)
Expand Down
2 changes: 1 addition & 1 deletion spec/overcommit/hook/pre_commit/bundle_audit_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@
end

before do
subject.stub(:execute).with(%w[git ls-files -o -i --exclude-standard]).
subject.stub(:execute).with(%w[git ls-files -o -i --exclude-standard -- Gemfile.lock]).
and_return(double(stdout: ''))
subject.stub(:execute).with(%w[bundle-audit]).and_return(result)
end
Expand Down