Bug 1375834 - [mozlint] Stop printing vcs command used if command returns non-zero, r?bc
MozReview-Commit-ID: HfG5CqQDIdr
--- a/python/mozlint/mozlint/vcs.py
+++ b/python/mozlint/mozlint/vcs.py
@@ -33,18 +33,19 @@ class VCSHelper(object):
def create(cls):
vcs, root = cls.find_vcs()
return vcs_class[vcs](root)
def run(self, cmd):
try:
files = subprocess.check_output(cmd, stderr=subprocess.STDOUT).split()
except subprocess.CalledProcessError as e:
- print(' '.join(cmd))
- print(e.output)
+ if e.output:
+ print(' '.join(cmd))
+ print(e.output)
return []
return [os.path.join(self.root, f) for f in files if f]
def by_workdir(self, workdir):
return []
def by_outgoing(self, dest='default'):
return []