Instead of the deprecated _git_getoutput() method. Also, capture stderr
and put the error message to the exception, instead.
Signed-off-by: Markus Lehtonen <markus.lehtonen@linux.intel.com>
def show(self, id):
"""git-show id"""
- commit, ret = self._git_getoutput('show', [ "--pretty=medium", id ])
+ commit, stderr, ret = self._git_inout('show', ["--pretty=medium", id],
+ capture_stderr=True)
if ret:
- raise GitRepositoryError("can't get %s" % id)
+ raise GitRepositoryError("can't get %s: %s" % (id, stderr))
for line in commit:
yield line