From 7023caba944a6480d3a83cd4dd8e5d64b70e29dd Mon Sep 17 00:00:00 2001 From: DanielChabrowski Date: Tue, 19 Mar 2019 08:34:30 +0100 Subject: [PATCH] Execute with xargs in try_repo --- pre_commit/commands/try_repo.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/pre_commit/commands/try_repo.py b/pre_commit/commands/try_repo.py index e55739e0..3e256ad8 100644 --- a/pre_commit/commands/try_repo.py +++ b/pre_commit/commands/try_repo.py @@ -15,6 +15,7 @@ from pre_commit.commands.run import run from pre_commit.store import Store from pre_commit.util import cmd_output from pre_commit.util import tmpdir +from pre_commit.xargs import xargs logger = logging.getLogger(__name__) @@ -39,7 +40,7 @@ def _repo_ref(tmpdir, repo, ref): staged_files = git.get_staged_files(cwd=repo) if staged_files: - cmd_output('git', 'add', *staged_files, cwd=repo, env=env) + xargs(('git', 'add', '--'), staged_files, cwd=repo, env=env) cmd_output('git', 'add', '-u', cwd=repo, env=env) git.commit(repo=shadow)