mirror of
https://github.com/pre-commit/pre-commit.git
synced 2026-02-17 00:04:42 +04:00
Fix try-repo for staged untracked changes
This commit is contained in:
parent
71c238d4ec
commit
888787fb2d
3 changed files with 20 additions and 1 deletions
|
|
@ -91,11 +91,12 @@ def get_conflicted_files():
|
|||
return set(merge_conflict_filenames) | set(merge_diff_filenames)
|
||||
|
||||
|
||||
def get_staged_files():
|
||||
def get_staged_files(cwd=None):
|
||||
return zsplit(cmd_output(
|
||||
'git', 'diff', '--staged', '--name-only', '--no-ext-diff', '-z',
|
||||
# Everything except for D
|
||||
'--diff-filter=ACMRTUXB',
|
||||
cwd=cwd,
|
||||
)[1])
|
||||
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue