diff --git a/lib/format-staged/job.rb b/lib/format-staged/job.rb index bc6acd9..e061fec 100644 --- a/lib/format-staged/job.rb +++ b/lib/format-staged/job.rb @@ -39,7 +39,7 @@ module FormatStaged return false unless formatted.size == files.size quiet = @verbose ? [] : ['--quiet'] - return get_status('git', 'diff-index', '--cached', '--exit-code', *quiet, 'HEAD') != 0 + return !write || get_status('git', 'diff-index', '--cached', '--exit-code', *quiet, 'HEAD') != 0 end def repo_root