summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLars Wirzenius <liw@liw.fi>2017-03-25 16:10:05 +0200
committerLars Wirzenius <liw@liw.fi>2017-03-25 16:10:05 +0200
commitd25974cc09b9a69dc326322c9102229a8fbe19cf (patch)
treef6c23a5ecf61225f8959104ce21231cb2019a8f9
parent8394b861a0a05a4256eee265f2ed19e92930667d (diff)
downloaddistix-d25974cc09b9a69dc326322c9102229a8fbe19cf.tar.gz
Fix: Use xargs to run git add to avoid overlog argv
-rw-r--r--distixlib/git.py6
1 files changed, 5 insertions, 1 deletions
diff --git a/distixlib/git.py b/distixlib/git.py
index 843384b..648b374 100644
--- a/distixlib/git.py
+++ b/distixlib/git.py
@@ -32,7 +32,11 @@ class Git(object):
self._git(['init', '-q', self._dirname])
def add_and_commit(self, filenames, commit_msg):
- self._git(['add'] + filenames, cwd=self._dirname)
+ cliapp.runcmd(
+ ['xargs', '-0', 'git', 'add'],
+ cwd=self._dirname,
+ feed_stdin='\0'.join(filenames))
+
self._git(
['commit', '-q', '-m', commit_msg] + filenames,
cwd=self._dirname)