GitRepository.show: use _git_inout()
authorMarkus Lehtonen <markus.lehtonen@linux.intel.com>
Mon, 25 Mar 2013 09:09:36 +0000 (11:09 +0200)
committerGuido Günther <agx@sigxcpu.org>
Sat, 6 Apr 2013 22:07:48 +0000 (00:07 +0200)
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>
gbp/git/repository.py

index 9dd4748..bf32894 100644 (file)
@@ -1287,9 +1287,10 @@ class GitRepository(object):
 
     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