Skip to content

Commit 8977a28

Browse files
committed
Ignore the stderr output when getting the parent tag
1 parent 9df35c1 commit 8977a28

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

TarSCM/helpers.py

+2-2
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ def file_write_legacy(fname, string, *args):
2525

2626

2727
class Helpers():
28-
def run_cmd(self, cmd, cwd, interactive=False, raisesysexit=False):
28+
def run_cmd(self, cmd, cwd, interactive=False, raisesysexit=False, includeStderr=True):
2929
"""
3030
Execute the command cmd in the working directory cwd and check return
3131
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):
3737
proc = subprocess.Popen(cmd,
3838
shell=False,
3939
stdout=subprocess.PIPE,
40-
stderr=subprocess.STDOUT,
40+
stderr=subprocess.STDOUT if includeStderr else subprocess.DEVNULL,
4141
cwd=cwd)
4242
output = ''
4343
if interactive:

TarSCM/scm/git.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -307,7 +307,7 @@ def _detect_parent_tag(self, args=None):
307307
cmd.append("--match=%s" % args['match_tag'])
308308
except KeyError:
309309
pass
310-
rcode, output = self.helpers.run_cmd(cmd, self.clone_dir)
310+
rcode, output = self.helpers.run_cmd(cmd, self.clone_dir, includeStderr=False)
311311

312312
if rcode == 0:
313313
# strip to remove newlines

0 commit comments

Comments
 (0)