Change how we apply lazy to the git hook

This commit is contained in:
Ian Cordasco 2016-10-24 18:29:45 -05:00
parent 0285359a14
commit 941896218d
No known key found for this signature in database
GPG key ID: 656D3395E4A9791A
2 changed files with 36 additions and 4 deletions

View file

@ -140,11 +140,14 @@ def make_temporary_directory_from(destination, directory):
def find_modified_files(lazy):
diff_index = piped_process(
['git', 'diff-index', '' if lazy else '--cached', '--name-only',
'--diff-filter=ACMRTUXB', 'HEAD'],
)
diff_index_cmd = [
'git', 'diff-index', '--cached', '--name-only',
'--diff-filter=ACMRTUXB', 'HEAD'
]
if lazy:
diff_index_cmd.remove('--cached')
diff_index = piped_process(diff_index_cmd)
(stdout, _) = diff_index.communicate()
stdout = to_text(stdout)
return stdout.splitlines()