summaryrefslogtreecommitdiff
path: root/gbp/git
diff options
context:
space:
mode:
authorMarkus Lehtonen <markus.lehtonen@linux.intel.com>2012-09-26 15:07:56 +0300
committerGuido Günther <agx@sigxcpu.org>2012-11-07 21:09:58 +0100
commitb7cdef5e8b62cbaf41e330be9b54215ff8782dab (patch)
treeccce454e624f2c9357b0d1c6c510f0b595e851c9 /gbp/git
parentba854d88c5455ff7b1abab92c1d685d50855991d (diff)
GitRepository/diff: catch git error
Raise an exception if the git command fails. Also, utilize _git_inout() instead of the deprecated _git_getoutput(). Signed-off-by: Markus Lehtonen <markus.lehtonen@linux.intel.com>
Diffstat (limited to 'gbp/git')
-rw-r--r--gbp/git/repository.py4
1 files changed, 3 insertions, 1 deletions
diff --git a/gbp/git/repository.py b/gbp/git/repository.py
index dfe5cb2..0d65bcc 100644
--- a/gbp/git/repository.py
+++ b/gbp/git/repository.py
@@ -1368,7 +1368,9 @@ class GitRepository(object):
options = GitArgs(obj1, obj2)
if paths:
options.add('--', paths)
- output, ret = self._git_getoutput('diff', options.args)
+ output, stderr, ret = self._git_inout('diff', options.args)
+ if ret:
+ raise GitRepositoryError("Git diff failed")
return output
#}