mirror of
https://github.com/pre-commit/pre-commit.git
synced 2026-01-13 20:40:08 -06:00
Don't run on deleted files. Resolves #374
This commit is contained in:
@@ -69,7 +69,11 @@ def get_conflicted_files():
|
||||
|
||||
@memoize_by_cwd
|
||||
def get_staged_files():
|
||||
return cmd_output('git', 'diff', '--staged', '--name-only')[1].splitlines()
|
||||
return cmd_output(
|
||||
'git', 'diff', '--staged', '--name-only',
|
||||
# Everything except for D
|
||||
'--diff-filter=ACMRTUXB'
|
||||
)[1].splitlines()
|
||||
|
||||
|
||||
@memoize_by_cwd
|
||||
|
||||
Reference in New Issue
Block a user