Skip to content

Commit

Permalink
Merge pull request #1704 from Vynce/ignore-submodules
Browse files Browse the repository at this point in the history
Improve performance by ignoring submodules
  • Loading branch information
asottile committed Nov 20, 2020
2 parents 8419586 + 120d602 commit b368fbd
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 2 deletions.
4 changes: 3 additions & 1 deletion pre_commit/commands/run.py
Expand Up @@ -258,7 +258,9 @@ def _all_filenames(args: argparse.Namespace) -> Collection[str]:


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


Expand Down
4 changes: 3 additions & 1 deletion pre_commit/git.py
Expand Up @@ -130,7 +130,9 @@ def get_staged_files(cwd: Optional[str] = None) -> 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)))
intent_to_add = []
while parts:
Expand Down

0 comments on commit b368fbd

Please sign in to comment.