mirror of
https://github.com/PyCQA/flake8.git
synced 2026-04-05 12:36:54 +00:00
Change how we apply lazy to the git hook
This commit is contained in:
parent
0285359a14
commit
941896218d
2 changed files with 36 additions and 4 deletions
|
|
@ -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()
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue