Skip to content

Commit 7023cab

Browse files
Execute with xargs in try_repo
1 parent 24a2c3d commit 7023cab

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

pre_commit/commands/try_repo.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@
1515
from pre_commit.store import Store
1616
from pre_commit.util import cmd_output
1717
from pre_commit.util import tmpdir
18+
from pre_commit.xargs import xargs
1819

1920
logger = logging.getLogger(__name__)
2021

@@ -39,7 +40,7 @@ def _repo_ref(tmpdir, repo, ref):
3940

4041
staged_files = git.get_staged_files(cwd=repo)
4142
if staged_files:
42-
cmd_output('git', 'add', *staged_files, cwd=repo, env=env)
43+
xargs(('git', 'add', '--'), staged_files, cwd=repo, env=env)
4344

4445
cmd_output('git', 'add', '-u', cwd=repo, env=env)
4546
git.commit(repo=shadow)

0 commit comments

Comments
 (0)