summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMarkus Lehtonen <markus.lehtonen@linux.intel.com>2013-03-25 11:09:36 +0200
committerMarkus Lehtonen <markus.lehtonen@linux.intel.com>2013-04-03 09:13:49 +0300
commiteb3d9682e9f21e53725f809063d8b15bf6e7016d (patch)
tree220afdaba5f342a01a583a8a8d0cea654053b879
parent44c0d42269829479340cdb11f9e626f595f09347 (diff)
downloadgit-buildpackage-eb3d9682e9f21e53725f809063d8b15bf6e7016d.tar.gz
git-buildpackage-eb3d9682e9f21e53725f809063d8b15bf6e7016d.tar.bz2
git-buildpackage-eb3d9682e9f21e53725f809063d8b15bf6e7016d.zip
GitRepository.show: use _git_inout()
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>
-rw-r--r--gbp/git/repository.py5
1 files changed, 3 insertions, 2 deletions
diff --git a/gbp/git/repository.py b/gbp/git/repository.py
index 6e3cebac..0ace61c6 100644
--- a/gbp/git/repository.py
+++ b/gbp/git/repository.py
@@ -1288,9 +1288,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