diff options
author | Markus Lehtonen <markus.lehtonen@linux.intel.com> | 2013-03-25 11:09:36 +0200 |
---|---|---|
committer | Guido Günther <agx@sigxcpu.org> | 2013-04-07 00:07:48 +0200 |
commit | 92edb4eda14cf4b5fd1514feb7b81aa50456285c (patch) | |
tree | a7b0b2bc6beadc2b502fa740aa07dcbd98933c96 /gbp | |
parent | 54679ebc7bf86ac5312192d7a6a3f7a0595798c4 (diff) |
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>
Diffstat (limited to 'gbp')
-rw-r--r-- | gbp/git/repository.py | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/gbp/git/repository.py b/gbp/git/repository.py index 9dd47487..bf328946 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 |