diff --git a/TarSCM/helpers.py b/TarSCM/helpers.py index 0254a97e..c75d0a19 100644 --- a/TarSCM/helpers.py +++ b/TarSCM/helpers.py @@ -25,7 +25,7 @@ def file_write_legacy(fname, string, *args): class Helpers(): - def run_cmd(self, cmd, cwd, interactive=False, raisesysexit=False): + def run_cmd(self, cmd, cwd, interactive=False, raisesysexit=False, includeStderr=True): """ Execute the command cmd in the working directory cwd and check return value. If the command returns non-zero and raisesysexit is True raise a @@ -37,7 +37,7 @@ def run_cmd(self, cmd, cwd, interactive=False, raisesysexit=False): proc = subprocess.Popen(cmd, shell=False, stdout=subprocess.PIPE, - stderr=subprocess.STDOUT, + stderr=subprocess.STDOUT if includeStderr else subprocess.DEVNULL, cwd=cwd) output = '' if interactive: diff --git a/TarSCM/scm/git.py b/TarSCM/scm/git.py index 87bdfdb6..7cde3391 100644 --- a/TarSCM/scm/git.py +++ b/TarSCM/scm/git.py @@ -307,7 +307,7 @@ def _detect_parent_tag(self, args=None): cmd.append("--match=%s" % args['match_tag']) except KeyError: pass - rcode, output = self.helpers.run_cmd(cmd, self.clone_dir) + rcode, output = self.helpers.run_cmd(cmd, self.clone_dir, includeStderr=False) if rcode == 0: # strip to remove newlines