mirror of
https://github.com/pre-commit/pre-commit.git
synced 2026-02-17 08:14:42 +04:00
Merge pull request #1704 from Vynce/ignore-submodules
Improve performance by ignoring submodules
This commit is contained in:
commit
b368fbd1a0
2 changed files with 6 additions and 2 deletions
|
|
@ -258,7 +258,9 @@ def _all_filenames(args: argparse.Namespace) -> Collection[str]:
|
||||||
|
|
||||||
|
|
||||||
def _get_diff() -> bytes:
|
def _get_diff() -> bytes:
|
||||||
_, out, _ = cmd_output_b('git', 'diff', '--no-ext-diff', retcode=None)
|
_, out, _ = cmd_output_b(
|
||||||
|
'git', 'diff', '--no-ext-diff', '--ignore-submodules', retcode=None,
|
||||||
|
)
|
||||||
return out
|
return out
|
||||||
|
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -130,7 +130,9 @@ def get_staged_files(cwd: Optional[str] = None) -> List[str]:
|
||||||
|
|
||||||
|
|
||||||
def intent_to_add_files() -> List[str]:
|
def intent_to_add_files() -> List[str]:
|
||||||
_, stdout, _ = cmd_output('git', 'status', '--porcelain', '-z')
|
_, stdout, _ = cmd_output(
|
||||||
|
'git', 'status', '--ignore-submodules', '--porcelain', '-z',
|
||||||
|
)
|
||||||
parts = list(reversed(zsplit(stdout)))
|
parts = list(reversed(zsplit(stdout)))
|
||||||
intent_to_add = []
|
intent_to_add = []
|
||||||
while parts:
|
while parts:
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue