Skip to content

Commit 0799fc6

Browse files
authored
Merge pull request #346 from ekohl/fail-if-git-ls-files-failed
Fix check:git_ignore rake task for git >= 2.32.0
2 parents 0529fde + 30595b7 commit 0799fc6

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

lib/puppetlabs_spec_helper/rake_tasks.rb

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -323,7 +323,9 @@
323323

324324
desc 'Fails if directories contain the files specified in .gitignore'
325325
task :git_ignore do
326-
matched = `git ls-files --ignored --exclude-standard`
326+
matched = `git ls-files --ignored --exclude-standard --cached`
327+
raise 'git ls-files failed' unless $CHILD_STATUS.success?
328+
327329
unless matched == ''
328330
puts matched
329331
raise 'File specified in .gitignore has been committed'

0 commit comments

Comments
 (0)