Only check for staged changes if writing output
This commit is contained in:
parent
7da4a0e0f0
commit
aad741f8cc
1 changed files with 1 additions and 1 deletions
|
@ -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
|
||||
|
|
Loading…
Add table
Reference in a new issue