summaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorGuido Günther <agx@sigxcpu.org>2013-06-29 12:38:42 +0200
committerGuido Günther <agx@sigxcpu.org>2013-06-29 12:38:42 +0200
commit56068e5f326934558c16f7ee29c9ede74d461388 (patch)
treee7fb0dd414bc63709c3a01196f952764a5032c98
parent7fbdc34cbd3a60f5536485c2615b41396ca66ce7 (diff)
Git.Repository.__git_inout: properly set stdin
We should set stdin to subprocess.PIPE when piping input according to the subprocess docs.
-rw-r--r--gbp/git/repository.py5
1 files changed, 3 insertions, 2 deletions
diff --git a/gbp/git/repository.py b/gbp/git/repository.py
index 5d7e38cb..306d0bd8 100644
--- a/gbp/git/repository.py
+++ b/gbp/git/repository.py
@@ -1,6 +1,6 @@
# vim: set fileencoding=utf-8 :
#
-# (C) 2006,2007,2008,2011 Guido Guenther <agx@sigxcpu.org>
+# (C) 2006,2007,2008,2011,2013 Guido Guenther <agx@sigxcpu.org>
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 2 of the License, or
@@ -141,10 +141,11 @@ class GitRepository(object):
cmd = ['git', command] + args
env = cls.__build_env(extra_env)
stderr_arg = subprocess.PIPE if capture_stderr else None
+ stdin_arg = subprocess.PIPE if input else None
log.debug(cmd)
popen = subprocess.Popen(cmd,
- stdin=subprocess.PIPE,
+ stdin=stdin_arg,
stdout=subprocess.PIPE,
stderr=stderr_arg,
env=env,