From 92edb4eda14cf4b5fd1514feb7b81aa50456285c Mon Sep 17 00:00:00 2001 From: Markus Lehtonen Date: Mon, 25 Mar 2013 11:09:36 +0200 Subject: [PATCH] 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 --- gbp/git/repository.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/gbp/git/repository.py b/gbp/git/repository.py index 9dd4748..bf32894 100644 --- a/gbp/git/repository.py +++ b/gbp/git/repository.py @@ -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 -- 2.7.4