mirror of
https://github.com/pre-commit/pre-commit.git
synced 2026-04-16 10:31:46 +04:00
Switch back to diff instead of diff-index
`diff-index` appears to act strangely with `git add --intent-to-add`
This commit is contained in:
parent
51659ee606
commit
aae31993cd
2 changed files with 13 additions and 3 deletions
|
|
@ -29,10 +29,9 @@ def staged_files_only(patch_dir):
|
|||
context.
|
||||
"""
|
||||
# Determine if there are unstaged files
|
||||
tree = cmd_output('git', 'write-tree')[1].strip()
|
||||
retcode, diff_stdout_binary, _ = cmd_output(
|
||||
'git', 'diff-index', '--ignore-submodules', '--binary',
|
||||
'--exit-code', '--no-color', '--no-ext-diff', tree, '--',
|
||||
'git', 'diff', '--ignore-submodules', '--binary',
|
||||
'--exit-code', '--no-color', '--no-ext-diff', '--',
|
||||
retcode=None,
|
||||
encoding=None,
|
||||
)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue